PayOrc
Subscription Plan

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

MethodURL
POSThttps://api.payorc.com/subscriptions/v1/contract/cancel_subscription

Please use the test credentials for sandbox testing.

Authentication

Include the following headers in every request:

HeaderTypeDescription
merchant-keyStringYour merchant key
merchant-secretStringYour merchant secret

All API requests must be made over HTTPS. Requests made over plain HTTP will be rejected.

Request Body

FieldTypeRequiredDescription
subscription_idStringYesEncrypted 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)

FieldTypeDescription
messageStringHuman-readable status message
statusStringsuccess or error
codeStringStatus 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.

On this page