#jdesignv2_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1260006029056540813
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
You're making a separate API request after you get the webhook, correct?
This is what is happening... But after cs_test_ it should get the line items...
yup
because sometimes not all line items are included in the initial webhook event
And the weird thing IMO is that the Stripe API does not send any error... normally you (Stripe) have very good error messages but this time nothing is happening at all ...
And this is how I have implemented it in my code base - maybe there is smth wrong with it?
The Checkout Session API doesn't send the line_items by default. You have to expand those too
What's the payload from that request?
But it gives me only a "hand full" of line items...
you mean what Stripe sends me with the request?
this is the event data
What I can see in the stripe dashboard
Or do you mean what I actually get via this?
What you actually get via that
one sec...
I'm only seeing 3 line items on the Checkout Session, so I'm curious if you're also seeing 3 in the payload
3 should be correct but I need to build it again to see the payload in the cloud (vercel)
so give me a minute
Looks correct (with the data: [ [Object] , [Object], [Object] ] in line_items)
Okay, cool. So it's working as expected?
no... the api request still does nothing...
Or does it only work if has_more: true?
What do you mean? Didn't it give you the payload you just posted?
The problem is that if I have 3 or 6 line items it works without the api call - If I have more then that I need to get them via the api call... Sometimes I have 15 or more Line_items...
So I need that API call
But it just stops the whole process... and I dont quite get why...
I can make another example if you wantr
With more line items
Well, no line items will show up in the webhook event as far as I know. You will always have to make a separate API call if you want them.
Wait will give you another example event
give me a minute
So here is the second example:
This now has more then 15 line items and it says has_more: true - but when I want to get these line items the API call does not work...
And I need to get all line items once to fullfill the order in our system... :/
This is the event ID: evt_1PaQsqKBPpELGMIUAx8AMQSc
Ahhh, okay. You have to use pagination to get the rest. They won't all show up on the first request after a certain number of them: https://docs.stripe.com/api/pagination
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
const line_items = await stripe.checkout.sessions.listLineItems(session.id, {limit: 50, expand: ["data.price.product"]});
But isn't this actually doing that?
Or how else would I implement this logic?
Errr, wait.... have you tried getting just the Line Items: https://docs.stripe.com/api/checkout/sessions/line_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yeah that is what I try to use...
but it somehow does not return anything / has an endless loop or smth in it...
At least for me
What's the payload it sends back?
Nothing... It never comes back
that is the problem
No error / information what happened
I am just gonna try it again in dev mode locally
Locally it works as expected...
Sounds like there likely is an error somewhere when in prod vercel, but you'll have to dig to find it
And on vercel it does not
hmmmm
well
Can you maybe ask your colleagues if they have had a similiar issue once with vercel and stripe?
As it is very weird that only this api call does not work... everything else works as expected... (also on vercel) and on top of that it works completely fine locally (dev & production)...
We don't really have the ability to troubleshoot, even with a working vercel integration. There's no indication where the issue lies. You said it just doesn't do anything. Doesn't really give us a lot to go off of
yup me neither...
But well
Then I have to have another night shift - here we go...
Oof. Well, best of luck to you. If you have any other Stripe-related issues, feel free to pop back in