Cancel a subscription
This endpoint lets you cancel an active subscription programmatically.
This endpoint lets you cancel an active subscription programmatically.
You can either:
- Schedule the cancellation for the end of the current billing period.
- Cancel immediately.
- Optionally refund the most recent payment when canceling immediately.
Note
Refund options are only supported for immediate cancellations. If you send cancel_at_period_end: true, you should not include refund flags.
Authorization
bearerAuth Provide your SellApp API key as a bearer token.
In: header
Path Parameters
The subscription path parameter.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PATCH "https://sell.app/api/v2/subscriptions/0/cancel" \ -H "Content-Type: application/json" \ -d '{ "cancel_at_period_end": true }'{
"data": {
"id": 123,
"invoice_id": 456,
"provider": "stripe",
"subscription_id": "sub_1QwertyExample",
"customer_id": "cus_Example123",
"customer_email": "customer@example.com",
"status": "ACTIVE",
"current_period_start": "2026-03-01T00:00:00.000000Z",
"current_period_end": "2026-04-01T00:00:00.000000Z",
"cancel_at_period_end": true,
"cancellation_in_progress": false,
"store_id": 1,
"product_variant_id": 99,
"created_at": "2026-03-01T00:00:00.000000Z",
"updated_at": "2026-03-23T00:00:00.000000Z"
},
"message": "Subscription will be cancelled at the end of the current period."
}Overview
On this page, we’ll dive into the subscription cancellation endpoint you can use to manage subscriptions programmatically.
Cancel a subscription immediately with a refund PATCH
To cancel immediately and refund the latest subscription payment, send cancelatperiodend: false with refundlastpayment: true.