0
votes

Here's the use case I am trying to solve for:

Create a new monthly subscription of $1000 that starts on May 20 with the CancelAt field set to June 29.

Expected behavior:

  1. Stripe charges Customer $1000 on May 20
  2. Stripe charges Customer $1000 on June 20
  3. Stripe automatically cancels the subscription on June 29 with no further invoices
  4. Total amount charged: $2000

What I tried:

  1. Create a Susbcription with CancelAt of June 20 and ProrateBehavior=None

Actual Stripe behaviour:

  1. Stripe charged Customer $1000 on May 20 (correct)
  2. I see in the Stripe dashboard an upcoming invoice of $317.97 for period June 21 - June 29 (incorrect)
  3. I see in the Stripe dashboard that Subscription is set to cancel on June 29 (correct)
  4. Total amount that will be charged: $1317.97 (incorrect)

I can't seem to figure out what combination of fields would make stripe behave as I described. Isn't setting the Prorate behavior to None supposed to tell Stripe to never charge less than full amount? Seems like a common use case unless I am missing something?

Thanks for the help!

1

1 Answers

0
votes

Stripe Subscriptions are prepaid, so your May 20 invoice actually covers from May 20 to June 20, so this actually makes sense.

cancel_at specifically says:

A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using proration_behavior. If set during a future period, this will always cause a proration for that period. (emphasis mine)

You either want to just cancel the Subscription in June via the API with proration_behavior:none - potentially using metadata to record the 'when to cancel date' and webhooks to check if the subscription needs cancelling this period - or possibly use Subscription Schedules: https://stripe.com/docs/billing/subscriptions/subscription-schedules