Cancel Subscription
Cancel an active subscription to stop future billing for a subscriber.
Cancel Subscription
Version: 3.0.0
Generate an API Key for the Subscription channel before making requests.
Use this endpoint to cancel an active subscription. Cancelling a subscription stops all future billing for the subscriber. The subscription status will be updated to reflect the cancellation.
Endpoint
| Method | URL |
|---|---|
| POST | https://api.payorc.com/subscriptions/v1/contract/cancel_subscription |
Please use the test credentials for sandbox testing.
Authentication
Include the following headers in every request:
| Header | Type | Description |
|---|---|---|
merchant-key | String | Your merchant key |
merchant-secret | String | Your merchant secret |
All API requests must be made over HTTPS. Requests made over plain HTTP will be rejected.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
subscription_id | String | Yes | Encrypted contract identifier from Contract List (contract_details.subscription_id). The contract must be Active. |
Where to get this value: Call Contract List first. Copy contract_details.subscription_id (encrypted). Do not use contract_id (plain display number) or the subscription_id returned by Contract Details (that response field is the plain display ID).
Response (200 OK)
| Field | Type | Description |
|---|---|---|
message | String | Human-readable status message |
status | String | success or error |
code | String | Status code (00 for success) |
Code Examples
curl -X POST https://api.payorc.com/subscriptions/v1/contract/cancel_subscription \
-H "Content-Type: application/json" \
-H "merchant-key: YOUR_MERCHANT_KEY" \
-H "merchant-secret: YOUR_MERCHANT_SECRET" \
-d '{
"subscription_id": "dG0zSVVBRmFaWG"
}'Example Response
{
"message": "Subscription cancelled successfully.",
"status": "success",
"code": "00"
}Cancelling a subscription is irreversible. Once cancelled, the subscriber will no longer be billed. If you need to restart billing, a new subscription must be created.