#nicolas-m_webhooks

1 messages ยท Page 1 of 1 (latest)

crystal galeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1318329491386404934

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

queen mirage
brave zealot
#

which the first one is the non recurring charge

#

but there is (in non-rec. billing) a subscription parameter, with just an ID, but it is not null

queen mirage
#

what's the ID?

brave zealot
#

the charge id?

queen mirage
#

the not null subscription parameter

brave zealot
#

I got confused, sorry, it's not the subscription id, but an invoice id, so in this case there is no invoice object, but just an id, on both occasions

queen mirage
#

Correct. Invoice can be of one-off or recurring type.

You can retrieve the charge object and expand invoice property to see if there's a subscription parameter under invoice - https://docs.stripe.com/api/expanding_objects

OR You can retrieve the invoice using the API to see if the returned object has a subscription parameter - https://docs.stripe.com/api/invoices/retrieve

If subscription is null then its a one-off payment. Otherwise, it is recurring payment.

crystal galeBOT
brave zealot
#

get it, just one more question, can we expand the invoice object on the webhook response? (just as the object sent on Non Rec Stripe(1).txt)

queen mirage
#

Webhook responses can't be expanded. You'd need to make a separate API request to retrieve the object

brave zealot
#

okay, perfect, thank you for the patience and collaboration!