Adds helpers to cancel subscriptions for billing periods with mixed intervals
What’s new
We introduced the following cancel_at enum values to simplify cancelling a mixed interval subscription at the end of a billing period:
min_
: Schedules cancellation of the subscription at the earliestperiod_ end items.
across all subscription items.data. current_ period_ end max_
: Schedules cancellation of the subscription at the latestperiod_ end items.
across all subscription items.data. current_ period_ end
In requests that change both the current_
of a Subscription item and set one of these new values, the updated current_
is taken as the respective cancellation date. Unlike cancel_at_period_end, these values resolve to timestamps immediately and further changes to items.
don’t affect them.
Note
For mixed interval subscriptions the existing cancel_at_period_end feature always resolves to the earliest item period end.
Impact
The following API endpoints support the new enums:
If your flexible billing mode integration currently uses cancel_at_period_end to cancel subscriptions, update your integration to either:
- Use the new
min_
orperiod_ end max_
enum values to specify which interval triggers cancelation.period_ end - Populate cancel_at with an explicit integer timestamp.
The cancel_
parameter on a Subscription isn’t compatible with the new cancel_
helpers.
If you update the current_
value for items in a subscription, you can add cancel_
or cancel_
in the same request to reset the subscription’s existing cancel_at timestamp.