#andy_invoice-metadata

1 messages ¡ Page 1 of 1 (latest)

versed pondBOT
#

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

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

spark breachBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

clear vine
#

@flat thunder you siad you asked this before, so I assume we gave you some options. And I assumethe problem is for the first Invoice on a Subscription which gets finalized synchronously, in which case this is just not possible unless you put it on the Subscription.

#

andy_invoice-metadata

flat thunder
#

yes the original issue was that the first invoice finalized instantly and did not have that 1 hour delay

#

Dealing with a race condition, since I try to change the invoice at invoice.created event and the integration is listening for invoice.payment_succeeded

#

options given were
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.

clear vine
#

yes that's mostly not possible with the first Invoice, no real way around it if you use the Subscriptions API unless you use the trial trick

Alternatively you can use the SubscriptionSchedules API instead as that one does not finalize the first Invoice automatically

flat thunder
#

the trial trick didnt work since, it would create two invoices, am I missing something there?

#

would I know the upcoming invoice when the trial trial is created?

clear vine
#

yes it creates two Invoices and lets you do exactly what you want for the second Invoice. It's a trick, it's not perfect, it's just a viable workaround that you have to adapt to

flat thunder
#

okay i understand now

clear vine
#

My trick is likely better for you and what you really want

flat thunder
#

this would trigger the 1 hour draft time? (with the trial trick)

clear vine
flat thunder
#

okay thank you for the trick

clear vine
#

sure thing!