Refund API
POST/rest/refund
/rest/refundProduction URL
https://api.betterpayment.de/rest/refundTest URL
https://testapi.betterpayment.de/rest/refundRefund API is used to refund full or partial amounts of payments that were made by merchants' customers. There can be multiple refunds per transaction, however, the combined sum of refunds should not exceed the total amount of the transaction.
Partial refunds are not supported by all payment methods. Please check the Transaction Types section from Payment Methods if your payment method supports it.
Refund API Request
transaction_idStringrequiredmerchant_referenceStringmerchant_reference from original transaction. String length different per payment methodamountFloatexecution_dateDateYYYY-MM-DDcommentStringPOST /rest/refund
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"transaction_id": "f3ba29ea-5644-4e4b-aacd-8d854ebb3d46",
"merchant_reference": "12345678 - Test Shop",
"amount": "10.00",
"execution_date": "2025-02-19",
"comment": "Customer returned item"
}
Refund API Response
The response is attributed to the Refund object — not the transaction. Thus, the status_code and status will differ from transaction values.
transaction_idStringrefund_idStringstatusStringstatus_codeIntegererror_codeInteger{
"transaction_id": "f3ba29ea-5644-4e4b-aacd-8d854ebb3d46",
"refund_id": "2ce3297b-1bda-4637-9375-ecf224cdefc7",
"status_code": 1,
"status": "successful",
"error_code": 0
}
Postbacks
When a refund is completed or its status changes, the API sends an HTTP POST request to the postback_url associated with the original transaction. This allows your system to receive real-time refund updates.
All postback URLs must use HTTPS and support TLS 1.2 or higher. Non-secure or HTTP URLs will be rejected.
Refund Postback — Completed
transaction_idStringpayment_typeStringstatus_codeIntegerstatusStringorder_idStringmessageStringrefund_remittance_infoStringrefund_wallet_activity_referenceStringpayer_locationStringadditional_transaction_dataStringamountFloatrefund_status_codeInteger0 Started, 1 Success, 2 Error, 3 Local, 4 Reversed, 5 Declinedrefund_idStringincluded_feesStringchecksumString{
"transaction_id": "609c412f-53bf-4185-bdb4-7c34225607a6",
"payment_type": "wero",
"status_code": 7,
"status": "refunded",
"order_id": "123000",
"message": "REFUND SETTLED",
"refund_remittance_info": "12345678 - Test Shop",
"refund_wallet_activity_reference": "RWARb23dc80e71af",
"payer_location": "DE",
"additional_transaction_data": null,
"amount": 10.0,
"refund_status_code": 1,
"refund_id": "58dd2ec9-c6b4-40ec-92d2-047d2913b209",
"included_fees": "0.00",
"checksum": "a7227a1ee524d9da88515cb162656db21701cc74"
}
Refund Postback — Declined
transaction_idStringpayment_typeStringstatus_codeIntegerstatusStringorder_idStringmessageStringrefund_reason_codeStringrefund_wallet_activity_referenceStringpayer_locationStringadditional_transaction_dataStringamountFloatrefund_status_codeInteger0 Started, 1 Success, 2 Error, 3 Local, 4 Reversed, 5 Declinedrefund_idStringincluded_feesStringchecksumString{
"transaction_id": "609c412f-53bf-4185-bdb4-7c34225607a6",
"payment_type": "wero",
"status_code": 7,
"status": "refunded",
"order_id": "123000",
"message": "REFUND REJECTED",
"refund_reason_code": "AC04",
"refund_wallet_activity_reference": "RWARb23dc80e71af",
"payer_location": "DE",
"additional_transaction_data": null,
"amount": 10.0,
"refund_status_code": 5,
"refund_id": "58dd2ec9-c6b4-40ec-92d2-047d2913b209",
"included_fees": "0.00",
"checksum": "a7227a1ee524d9da88515cb162656db21701cc74"
}
For details on retry policy and signature verification, see Postbacks.