Skip to main content
POST
/
subscriptions
/
{subscriptionId}
/
cancel
Cancel a subscription
curl --request POST \
  --url https://api.recurr.dev/v1/subscriptions/{subscriptionId}/cancel \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "at_period_end": true
}
'
{
  "id": "sub_01HQ...",
  "plan": "premium_monthly",
  "current_period_start": "2023-11-07T05:31:56Z",
  "current_period_end": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Your Recurr secret API key as a Bearer token: Authorization: Bearer rk_live_….

Keys are environment-scoped — rk_live_ operates on live data, rk_test_ on isolated test data (see Test mode). Create, scope, and rotate keys in your dashboard (Settings → API keys, developer role). Secret keys are server-side only — never ship them in an app binary or client JavaScript.

Headers

Idempotency-Key
string

Idempotency key for safe retries on write operations. Pass a unique key per logical request; Recurr returns the original response for duplicate keys within a 24-hour window.

Maximum string length: 255

Path Parameters

subscriptionId
string
required

Body

application/json
at_period_end
boolean
default:true

If true, cancel takes effect at current period end. If false, immediate.

reason
enum<string>
Available options:
customer_request,
compliance,
fraud,
duplicate,
admin_override

Response

200 - application/json

Subscription cancelled

id
string
required
Example:

"sub_01HQ..."

status
enum<string>
required
Available options:
active,
trialing,
paused,
cancelled,
lapsed
plan
string
required
Example:

"premium_monthly"

current_period_start
string<date-time>
required
current_period_end
string<date-time>
required