Subscriptions
API ReferenceSubscriptionsCancel
Cancel Subscription
Cancel an existing subscription.
POST /subscriptions/{subscription_id}/cancel
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subscription_id | string | Yes | The unique identifier for the subscription. |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
api-key | string | Yes | Your secret API key. |
X-Profile-Id | string | Yes | Profile ID for authentication. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
cancel_option | string | No | When to cancel: immediately, end_of_term, specific_date. |
cancel_at | string | No | Specific date to cancel the subscription (ISO format). |
unbilled_charges_option | string | No | How to handle unbilled charges: invoice or delete. |
credit_option_for_current_term_charges | string | No | Credit handling: none, prorate, full. |
account_receivables_handling | string | No | Receivables handling: no_action, schedule_payment_collection, write_off. |
refundable_credits_handling | string | No | Refundable credits: no_action, schedule_refund. |
cancel_reason_code | string | No | Reason for cancelling the subscription. |
Request Example
curl -X POST 'https://api.sandbox.paychtec.com/subscriptions/sub_123/cancel' \ -H "Content-Type: application/json" \ -H "api-key: snd_YOUR_API_KEY" \ -H "X-Profile-Id: prof_12345" \ -d '{ "cancel_option": "immediately", "credit_option_for_current_term_charges": "prorate", "refundable_credits_handling": "schedule_refund", "unbilled_charges_option": "invoice"}'