Subscription cancellations
A subscription can be canceled at any point. Cancellation is modelled as a separate resource in the API, so the cancellation has its own ID and its own properties — distinct from the subscription itself.
Immediate vs scheduled cancellation
Both use the same endpoint, but the cancelAt field changes the timing.
Immediate cancellation
Omit cancelAt. The subscription transitions to canceled straight away and no further renewals are charged.
curl -i -X POST \
'https://staging-api.payments.ai/v1/public-api/organizations/${ORGANIZATION_ID}/subscription-cancellations' \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey ${API_KEY}' \
-d '{
"subscriptionId": "ord_xxx",
"reason": "did-not-want"
}'