Skip to main content
POST
/
v2
/
subscriptions
/
{id}
/
cancel

Cancel Subscription

Cancel a subscription either immediately or at the end of the current billing period.

Authentication

Authorization: Bearer glm_test_YOUR_API_KEY

Path Parameters

ParameterTypeRequiredDescription
idstringYesSubscription ID

Request Body

{
  "cancel_at_period_end": true,
  "reason": "customer_request"
}
ParameterTypeRequiredDescription
cancel_at_period_endbooleanNoIf true, cancel at period end (default: false)
reasonstringNoCancellation reason

Response

{
  "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"
}

Examples

Cancel at Period End

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"
  }'

Immediate Cancellation

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
  }'