#JackS
1 messages ยท Page 1 of 1 (latest)
Hi ๐ I believe so, but do you have an example of a Subscription from your testing that had a one-time coupon applied that I can take a closer look at to double check?
sub_sched_1NgSc0ByUW5gLVs3AIhbiuwj already used
sub_sched_1NgSuKByUW5gLVs3m99XT7ku next phase used
so there are two the first one is subscription schedule when the discount has been applied the last payment and the second when is subscription schedule when the coupon will be applied to the next payment
Both of those Subscription Schedules appear to only have one phase, so in both cases it looks like the Coupon is listed on the Subscription, so I think you would have a hard time using that to indicate when the Coupon was used.
Instead I think you're going to have to look back at past Invoices for the Subscription and see if they were discounted.
https://stripe.com/docs/api/invoices/object#invoice_object-discounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So on the subscription and schedule objects the data isn't there, I must check the invoices to know if the coupon has been used or not?
Correct, the Coupon is referenced on the Subscription and Subscription Schedule, but it is not possible to determine whether the coupon was previously used from there.
what is the best way to see the next charge, similar to how you can see it on the dashboard?
For Subscriptions, you can use the retrieve upcoming invoice endpoint to get a preview of what the next Invoice for the Subscription will look like:
https://stripe.com/docs/api/invoices/upcoming
It's worth noting that this does not actually generated the next Invoice, it only sends a preview of what it would look like.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok thank you
Any time!