#andrewandyandy_api

1 messages ¡ Page 1 of 1 (latest)

river plankBOT
#

👋 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/1215397410575228960

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

wide archBOT
torn gate
#

Creating invoices with up front payment for the first invoice finalize immediately, that is expected

#

What are you trying to do? What's not working because of this?

severe meadow
#

We have a partner, PartnerStack that listens to invoice.payment_succeeded and they're looking at the invoice.metadata to know what type of product it is

#

I have code that updates the invoice when invoice.created event trigger but since it finalized instantly invoice.payment_succeeded gets trigger before my code finish updating the invoice

torn gate
#

Are these $0 invoice or are they being paid by a payment method you already have on hand?

#

(otherwise i don't understand how the payment happens right away)

severe meadow
#

they being paid by a payment method already on hand

torn gate
#

Gotcha

severe meadow
#

this is instant?

torn gate
#

More or less, yes

#

So, a couple options

#

1/ You can put metadata on the subscription and the generated invoice will get a snapshot of that automatically, but its under subscription_details:
https://docs.stripe.com/api/invoices/object#invoice_object-subscription_details-metadata
This is likely impractical because you don't control the other integration to change where they look

2/ As a workaround, you can add a short trial period to the subscription using trial_end={a few minutes from now} this will create an initial free trial period then renew with the paid invoice and the async finalization you're looking for.

severe meadow
#

thank you for the options. The first option I've asked them to use but they wouldnt budge

#

I will take a look at the 2nd option