#tbhaxor-invoice

1 messages · Page 1 of 1 (latest)

lofty dome
#

hi there! can you elaborate more on the scenario?

sudden arch
#

Hi @pure acorn what can I help?

pure acorn
#

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?

sudden arch
#

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.

pure acorn
#

I have a check for this if (object.subscription === null) return res.sendStatus(200). We are only handling invoices from the subscription

pure acorn
#

Any updates on this @sudden arch @lofty dome ?

sudden arch
#

Hi @pure acorn I've answered your question, did you see my message?

pure acorn
#

Yes I have read that already. I was confirming with you

sudden arch
#

What do you want to confirm?

pure acorn
#

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

sudden arch
pure acorn
#

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

sudden arch
#

The answer is we can't guarantee. Please read the doc that I just sent earlier.

pure acorn
#

Ohk nvm, I read that already, btw. Please close this thread 😄

pure acorn
#

Updating subscription item from subscription.update("id", {items: [{id: item.id, price: newPriceId}]}) is same as subscriptionItems.update(item.id, {price: newPriceId})?

sudden arch
#

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.

pure acorn
#

yeah, two apis for same thing was kinda confusing

#

thanks for the clearing the confusion

sudden arch
#

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.