Skip to main content

Cancel API

POST/rest/cancel

Cancel API is used to cancel an active PayPal subscription. Pass the transaction_id of the original subscription setup transaction (the initial POST /rest/payment with recurring: 1 and paypal_plan_id).

info

This endpoint is for PayPal Subscriptions only. It does not cancel one-time PayPal payments or reverse authorizations — use the Reversal API for uncaptured authorizations.

Cancel API Request

transaction_idStringrequired
Transaction ID of the original subscription setup transaction
reasonString
Reason for cancellation. Defaults to NO REASON when omitted
Example Request
POST /rest/cancel
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"transaction_id": "c2a6bf6d-2dd7-4a9c-b4de-2d04347d802b",
"reason": "Customer requested cancellation"
}

Cancel API Response

transaction_idString
ID of the subscription setup transaction
order_idString
Order ID of the transaction
status_codeInteger
Status code of the transaction
statusString
Status of the transaction (typically canceled)
paypal_subscription_idString
PayPal Subscription ID
paypal_plan_idString
PayPal Plan ID
error_codeInteger
Error code for the response (0 for success)
Example Response
{
"transaction_id": "c2a6bf6d-2dd7-4a9c-b4de-2d04347d802b",
"order_id": "123000",
"status_code": 5,
"status": "canceled",
"paypal_subscription_id": "I-B3452HHDSD",
"paypal_plan_id": "P-6UK2193323222643NMFJN66Q",
"error_code": 0
}