#Akin
1 messages ยท Page 1 of 1 (latest)
Hi ๐ no. That function generates a preview of the next Invoice, but does not actually generate that next Invoice so no ID is available for it. The ID of the Invoice object will not be available until the object is created.
Ah okay, would you suggest using payment intent in this case? I am looking to apply discount to the invoice before creating the actual subscription
No, Subscriptions automatically create Invoices which automatically create Payment Intents so you typically don't need to create your own intents when working with Subscriptions.
Are you planning to use a Coupon for to apply that discount?
Yes
Gotcha, you can pass the ID of that Coupon when creating the Subscription via 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.
Okay will try that. Thanks!
Any time!