/subscriptions/{id}/cancel
Accepted, not done yet; the gateway is called in the background. By default the subscription ends at the end of the paid period; send at_period_end false to end it now. The outcome arrives as subscription.canceling and subscription.canceled webhooks.
Server URLhttps://pay.contagorda.com/api/v1
POST/subscriptions/{id}/cancel
Authorization
Bearer token: an app key from Apps (sk_app_live_… or sk_app_test_…), or the tenant key from Settings (sk_live_… or sk_test_…). The key picks the mode: a live key only sees live data, a test key only sandbox data.
Parameters
idstring · pathrequired
The resource id.
Request Body
application/json, optional
at_period_endbooleanoptional
false ends the subscription now, without refunding the current period.
Default true
Response Body
202Cancellation requested.
idstringoptional
Format uuid
statusstringoptional
Stays active until the subscription really ends.
cancel_requested_atstringoptional
Format date-time
cancel_atstringoptional
Format date-time
linksobjectoptional
selfstringoptional
Format uri
401Missing or invalid secret key.
errorstringoptional
What went wrong.
404No such resource for this tenant.
errorstringoptional
What went wrong.
422The subscription is already canceled or has not started yet.
errorsobjectoptional
One message per field (idempotency_key, gateway, amount, replaces, subscription or record).