Cancel subscription
API Refs
- Staging: Cancel subscription
Path parameters
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | StripeSubscriptionID to cancel | yes |
Request body (Optional)
| Name | Type | Description | Required |
|---|---|---|---|
| cancellationReason | string | Reason for cancellation - logged for auditing purposes | no |
Response
Success Response (200 OK)
| Field | Type | Description |
|---|---|---|
| id | string | Subscription ID |
| status | string | Updated subscription status |
| canceledAt | string | Cancellation timestamp (ISO 8601) |
Response
{
"id": "sub_ExampleSubscription789",
"status": "canceled",
"canceledAt": "2024-01-15T14:30:00.000Z"
}Description
This endpoint cancels a subscription immediately or at the end of the current billing period. The subscription status will be updated to canceled and the cancellation timestamp will be recorded. You can optionally provide a cancellation reason for auditing purposes.
Error Responses
- 401 Unauthorized: Invalid or missing authorization token
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Subscription not found
Updated 12 months ago
Did this page help you?