Skip to main content
DELETE
Cancel Subscription
Cancel a subscription immediately or schedule cancellation for the next renewal boundary. Use this endpoint only from an authenticated merchant backend. Derive the customer from the logged-in user or team; never accept an authoritative customer_id from browser input. Auth: secret key only. Publishable keys are always rejected.
string
required
The subscription ID to cancel.
string
required
External customer ID derived by the trusted merchant backend. The subscription must belong to that customer and organization.
string
default:"immediate"
end_of_period keeps the subscription active until its next renewal boundary. immediate terminates it now. The raw HTTP API defaults to immediate for backward compatibility; the Node.js and Python SDK methods default to end_of_period.

Response

For end_of_period, the subscription remains active and ending_at contains the next renewal boundary. The billing engine terminates it at that boundary and prevents another renewal invoice. Repeating the request does not extend an earlier scheduled ending. For immediate, the response contains the terminated subscription.