Cancel subscription

📘

API Refs

Path parameters

NameTypeDescriptionRequired
idstringStripeSubscriptionID to cancelyes

Request body (Optional)

NameTypeDescriptionRequired
cancellationReasonstringReason for cancellation - logged for auditing purposesno

Response

Success Response (200 OK)

FieldTypeDescription
idstringSubscription ID
statusstringUpdated subscription status
canceledAtstringCancellation 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