Canceling a Subscription
curl -X POST https://api.fluxrate.co/api/v1/subscriptions/<subscription_id>/cancel \
-H "Content-Type: application/json" \
-H "Cookie: access_token=<token>" \
-d '{
"cancel_at_period_end": true,
"reason": "Customer requested cancellation"
}'
Cancellation Options
| Option | Description |
|---|
cancel_at_period_end: true | Subscription remains active until the current period ends, then cancels |
cancel_at_period_end: false | Subscription cancels immediately |
Immediate cancellation (cancel_at_period_end: false):
- Status changes to
CANCELED right away
- A final prorated invoice is generated for usage up to the cancellation date
- No future invoices
End-of-period cancellation (cancel_at_period_end: true):
- Status remains
ACTIVE until the period ends
canceled_at is set to the cancellation request time
- Subscription proceeds normally until
current_period_end
- Cancels automatically after the last invoice
Deleting a Subscription
To permanently delete a subscription record:
DELETE /api/v1/subscriptions/<subscription_id>
Deleting a subscription is permanent and cannot be undone. Canceling is preferred — it preserves billing history while stopping future charges.