Change a subscription's plan
Moves a subscription to a different price. BillKit prices the switch, charges the difference against the existing mandate, and applies the new plan when that payment settles.
Parameters
| Parameter | Description |
|---|---|
| subscription_idstring · pathrequired | No description in the spec. |
| target_price_idstringrequired | No description in the spec. |
Returns
The subscription as it stands right now, which is still on the old price. The switch is asynchronous: this call only mints the charge. Watch for subscription.updated, and for payment.succeeded or payment.failed alongside it.
The price of the switch is a credit for the unused part of the current period, subtracted from the full new price. Preview it first if you want to show the customer the number before they commit.
A change that would charge less than one unit of currency is refused with 400 parameter_invalid. The
customer has already paid through nearly all of the period, so waiting for the renewal bills them at the new rate
anyway.
Test it
Change the plan, then advance a test clock past the period end and read the invoice that falls out.
Errors
| Status | Cause |
|---|---|
| 401 | Missing or invalid API key. |
| 403 | Key is missing the subscriptions:write scope. |
| 404 | No such object, or it belongs to the other mode. |
| 422 | Validation Error |
| 429 | Rate limited. Back off and retry. |
Other subscriptions operations
- List subscriptions GET /v1/subscriptions
- Retrieve a subscription GET /v1/subscriptions/{subscription_id}
- Cancel a subscription POST /v1/subscriptions/{subscription_id}/cancel
- Pause subscription POST /v1/subscriptions/{subscription_id}/pause
- Preview update subscription POST /v1/subscriptions/{subscription_id}/preview_update
- Reactivate subscription POST /v1/subscriptions/{subscription_id}/reactivate
- Reauthorize payment method POST /v1/subscriptions/{subscription_id}/reauthorize_payment_method
- Resume subscription POST /v1/subscriptions/{subscription_id}/resume
BillKit