#tbhaxor-invoice
1 messages · Page 1 of 1 (latest)
Hi @pure acorn what can I help?
I cannot find the invoice.upcoming trigger in stripe cli. So I need to know that will I get invoice.created event before invoice.upcoming?
invoice.upcoming is triggered before a subscription is scheduled to create an invoice that's automatically charged.
invoice.created is triggered whenever an invoice is created, and it's not neccessarily to be created from subscription. An ad-hoc invoice creation will also trigger invoice.created.
I have a check for this if (object.subscription === null) return res.sendStatus(200). We are only handling invoices from the subscription
Any updates on this @sudden arch @lofty dome ?
Hi @pure acorn I've answered your question, did you see my message?
Yes I have read that already. I was confirming with you
What do you want to confirm?
Ohk let me ask this way. I am handling only subscription invoice. So when the upcoming invoice webhooks is triggered, will I get the invoice.created before it or invoice.created is only triggered when the invoice is finalized and open for the accepting payments
Let me know the term or phrase, if you couldnt understand the question
Stripe does not guarantee delivery of events in the order in which they are generated. https://stripe.com/docs/webhooks/best-practices#event-ordering
What happened Jack, I was always praised the stripe team for their great support :/
Anyways, tell me this, when the invoice.upcoming is triggered, will I get the invoice.created before or after the upcoming event?
Yes / No, binary answer please
The answer is we can't guarantee. Please read the doc that I just sent earlier.
Ohk nvm, I read that already, btw. Please close this thread 😄
Updating subscription item from subscription.update("id", {items: [{id: item.id, price: newPriceId}]}) is same as subscriptionItems.update(item.id, {price: newPriceId})?
If you have only one subscription item to update, then they are the same.
If you have more than one subscription items to update, then I'd suggest using subscription.update(... so that you can update multiple subscription items in just one API call.
yeah, two apis for same thing was kinda confusing
thanks for the clearing the confusion
No problem. Also I'd like to add on for my previous answer on the webhook event. In most cases the invoice.upcoming will arrive before invoice.created . However, if the webhook endpoint doesn't respond to the invoice.upcoming event. There's a possibility that the newly generated invoice.created event would arrive before the retried invoice.upcoming event.