Reversal API
POST/rest/reverse
/rest/reverseProduction URL
https://api.betterpayment.de/rest/reverseTest URL
https://testapi.betterpayment.de/rest/reverseReversal API is used to reverse (cancel) previously authorized transactions. This is essential when an authorization is no longer needed, such as when an order is cancelled before fulfillment or when reducing the authorized amount. Depending on the acquirer configured for your payment method, partial reversals (reversing less than the full amount) are supported.
Reversals can only be performed on authorized transactions that have not yet been captured. Once a transaction is captured, use the Refund API instead.
Reversal API Request
transaction_idStringrequiredamountFloatPOST /rest/reverse
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"transaction_id": "8296188e-dd59-4c58-96da-4981976a8e06",
"amount": 12.40
}
Full vs Partial Reversals:
- Full Reversal: Omit the
amountparameter to reverse the entire authorized amount - Partial Reversal: Specify an
amountless than the authorized amount to partially reverse the authorization. The remaining amount stays authorized and can be captured or reversed later.
Partial reversal support depends on your payment processor and acquirer configuration. Contact support to verify if partial reversals are available for your setup.
Reversal API Response
transaction_idStringstatus_codeIntegerstatusStringorder_idStringmessageStringerror_codeInteger{
"transaction_id": "8296188e-dd59-4c58-96da-4981976a8e06",
"status_code": 12,
"status": "reversed",
"order_id": "123000",
"message": "Request successfully processed in test mode.",
"error_code": 0
}
Use Cases
Hotel Reservation Cancellation
1. Guest makes reservation → Authorize $500
2. Guest cancels before check-in → Reverse $500
Restaurant Order Adjustment
1. Authorize $100 for estimated bill
2. Customer leaves early, actual bill is $60 → Partial reverse $40
3. Later capture $60 for the actual charge
E-commerce Order Cancellation
1. Authorize payment when order placed
2. Customer cancels before shipping → Full reversal