#ibgoldbergs
1 messages · Page 1 of 1 (latest)
Hi there
It sounds like you want the upcoming invoice endpoint: https://stripe.com/docs/api/invoices/upcoming
can we use upcoming invoices if there is no subscription yet?
oddly, we are using upcoming invoices already in the case of a subscription update (such as upgrade or downgrade) to show to amount due to the client
Oh got it. So if I just pass in for example:
- Coupon
- Customer
- subscription_items[0][price]
- subscription_items[0][tax_rates][0]
- subscription_proration_behavior
It should output how much the client would be charged upon creation of subscription?
Yep that looks right to me
doh. Seems like we are pretty close then
thanks for the help
Another question... How do we do this if we don't yet have a customer? We typically create the customer upon signup
When trying to hit the endpoint without a customer or subscription, I receive an error:
{
"error": {
"message": "You must either provide a customer or a subscription to the upcoming invoice endpoint.",
You can just create a placeholder Customer and then update the customer upon signup
Customers aren't required to have any particular information, so you can essentially just instantiate a blank one to be updated later with things like name, DOB, email, et.c
and if we don't need the customer, should we delete it? Or is a placeholder customer not actually created yet?
You need a Customer in order to have Subscriptions, so you have to keep it