#Nepho-subscription-id
1 messages ยท Page 1 of 1 (latest)
Hello! ๐
There is a loose reference to the Subscription object on the Payment Intent, but it's kind of buried and you'd need to make an additional API request anyway (as the fields need expanding)
I can do an additional API request, it's not a problem
Would you not instead listen for the response from the call to create the Subscription?
Or the customer.subscription.created event?
You'd want to retrieve the PI object, expanding the invoice.subscription field: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
More on 'expanding': https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But really you should instead do this async with a webhook handler
Oh, okay I didn't really think about using the webhook handler. I'll do this ๐ Thanks
Also related question, since I'm now using confirmPayment to create my subscription, at what point can I use a coupon?
Basically my "purchase review" screen currently looks like this
OK, nvm, nothing changes for this part!
I still send the promotion code as part of my initial StripeApi.subscriptions.create call ๐
Yep, you'd pass the coupon parameter: https://stripe.com/docs/api/subscriptions/create#create_subscription-coupon
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The discounted amount will be reflected on that initial Payment Intent
Thank you!
Np!