#aconn3lly

1 messages · Page 1 of 1 (latest)

ornate escarpBOT
somber wadi
#

No AFAIK. You would want to list all Invoices of it and sum

solid pawn
#

Sorry, not the total of all invoices but just the current total of the prices x quantities

#

I've worked it out myself in the past when it's simple unit pricing but we are looking at graduated tiered pricing and seems like we would need to calculate everything that Stripe calculates anyway

#

Was hoping not to replicate that logic on our side if possible

somber wadi
#

You can look at the latest Invoice and see what is included in it, no?

#

Invoice should have Invoice Items, with all the details

solid pawn
#

Not if they are currently on trial and haven't made a payment yet

somber wadi
#

How about Upcoming Invoice API?

solid pawn
#

That works unless there are scheduled changes for the subscription or the subscription is set to be cancelled

somber wadi
#

Umm so you have a Sub which is on trial, and are scheduled to cancel?

solid pawn
#

That could happen, by default we set to cancel_at_period_end for the trial, the user needs to add a payment method first for it to continue.

#

But even for subscriptions that are not on trial if they are set to cancel the upcoming payment will be $0

somber wadi
#

UpComing Invoice is a preview. When you call the Upcoming Invoice API, you can pass some parameters as the presume conditions, so for example you can ask it to preview "as if" the cancel will never happen

solid pawn
#

Ohhh that might be the go

somber wadi
#

When fetching the preview, you can also model what the invoice would look like if you changed the subscription in one of these ways:

  • Swapping the underlying price.
  • Altering the quantity.
  • Applying a trial period.
  • Adding a coupon.
#

Give it a try!