#Juni-Checkout
1 messages · Page 1 of 1 (latest)
Hello, let me clarify this. In the end what you would want to achieve is "moving" the Checkout metadata to Invoice? For now you are moving the Checkout metadata to Subscription, then read the Subscription to move to Invoice but unable to because of the race condition?
Correct. I update the subscription, but the update isn't guaranteed to take place completely by the time my server receives the invoice.paid webhook + retrieves it from stripe's servers
At least how I'm doing it now
When you create the Subscription Checkout, there is a parameter to prepare the metadata immediately: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Could you try this and drop off the logic to write into Subscription later? I assume these data will come directly to invoice.paid in webhook
Oh interesting, I missed this. I'll try this now, thanks!