#stevez4081
1 messages · Page 1 of 1 (latest)
hello! you can use https://stripe.com/docs/api/invoices/upcoming to preview the upcoming invoice when creating a new Subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
great, how would this work for a subscription that hasn't been created yet?
you can preview creating a subscription
great, is there documentation on that?
we don't actually have a guide for it, you would pass in the same details as if you were creating a Subscription
how do I make sure it isn't charged?
so I could same details / items to create invoice but with auto_advance: false?
yeah but its retrieving and I want to create one
sorry i'm not sure i understand, so are you saying you want to create a Subscription after using upcoming invoice to generate a preview?
I would like to preview a subscription price to a user before they're charged, I'd like to show the user the price they're about to be charged including credit, discounts and coupons in whatever currency they're using
yes, and using the upcoming invoice can do what you're looking for
have you tried it out?
I'm going through the API
We currently create a subscription and its charged immediately
can you share the request id where you've tried out the upcoming invoice?
I don't have one yet, are you saying to create an invoice or create a subscription? I'm trying to figure out which request I need to make
so I assume I would create a subscription in a draft status?
and then get the upcoming invoice?
You should use this API to preview creating a subscription : https://stripe.com/docs/api/invoices/upcoming. There is no need to create a Subscription first
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh i see
you will pass in the customer and subscription_items and any other parameters that you want to include