Cancel a subscription
cURL
curl --request POST \ --url https://api.example.com/v2/subscriptions/{id}/cancel
Authorization: Bearer glm_test_YOUR_API_KEY
id
{ "cancel_at_period_end": true, "reason": "customer_request" }
cancel_at_period_end
reason
{ "id": "sub_abc123xyz", "status": "cancelled", "cancel_at_period_end": true, "current_period_end": "2025-11-18T14:30:00Z", "cancelled_at": "2025-10-20T10:00:00Z" }
curl -X POST https://api.withgale.com/v2/subscriptions/sub_abc123xyz/cancel \ -H "Authorization: Bearer glm_test_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancel_at_period_end": true, "reason": "customer_request" }'
curl -X POST https://api.withgale.com/v2/subscriptions/sub_abc123xyz/cancel \ -H "Authorization: Bearer glm_test_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancel_at_period_end": false }'