Skip to main content
POST
Cancel Subscription
Cancel a subscription. By default it ends when the paid-for period runs out, so the customer keeps what they have already paid for. Until then the subscription stays active with cancel_at_period_end set to true.

Request authentication

This endpoint requires a Secret Key (sk_...).

Request parameters

boolean
default:"true"
false ends the subscription immediately instead.
string
Why it was canceled. Stored on the subscription for your own reporting.

Authorizations

x-api-key
string
header
required

Path Parameters

subscriptionId
string
required

Body

application/json
at_period_end
boolean
default:true
reason
string

Response

The subscription. Cancelling at period end leaves it active until the paid-for period runs out.

A single subscription.

message
string
data
object