#JackS

1 messages ยท Page 1 of 1 (latest)

turbid quailBOT
charred tangle
#

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?

lapis light
#

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

charred tangle
#

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

lapis light
#

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?

charred tangle
#

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.

lapis light
#

what is the best way to see the next charge, similar to how you can see it on the dashboard?

charred tangle
#

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.

lapis light
#

ok thank you

charred tangle
#

Any time!