Cancel API
POST/rest/cancel
/rest/cancelProduction URL
https://api.betterpayment.de/rest/cancelTest URL
https://testapi.betterpayment.de/rest/cancelCancel 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_idStringrequiredTransaction ID of the original subscription setup transaction
reasonStringReason for cancellation. Defaults to
NO REASON when omittedExample 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_idStringID of the subscription setup transaction
order_idStringOrder ID of the transaction
status_codeIntegerStatus code of the transaction
statusStringStatus of the transaction (typically
canceled)paypal_subscription_idStringPayPal Subscription ID
paypal_plan_idStringPayPal Plan ID
error_codeIntegerError 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
}