Create Reversal
An order can be reversed fully or partially. The amount parameter in the reverse request must be equal to the order's actual_amount value for a full reversal. Multiple partial reversals are allowed as long as the total sum of all partial reversals does not exceed the order's actual_amount.
Idempotent Reversal Key
The reverse_id parameter in the reverse request ensures safe retry attempts for reversals. It is generally not required for full reversals but can be used to prevent duplicate partial reversals.
For example, if an order amount is 1000 GBP and a partial reversal of 100 GBP is attempted but fails due to a network error, using the same reverse_id for retries ensures that the reversal does not duplicate (i.e., sending 100 GBP twice would not result in a 200 GBP refund).
Endpoint for order reverse
Reverse the order
POST /api/reverse/order_id
This endpoint expects a POST request in JSON format with the required parameters.
Normal response will contain reverse_status parameter which indicates if reversal is successful or not.
Request and response examples
Reversal operations require a signature for request validation. Learn how to generate and validate signatures in our Signatures guide.
- Request
- Normal Response
- Response in case of error
curl -L 'https://pay.fondy.eu/api/reverse/order_id' \
-H 'Content-Type: application/json' \
-d '{
"request": {
"order_id": "test_12343242111",
"currency": "GBP",
"amount": "1",
"signature": "29a569275265925c2ec356d3adada1929fd8bb8c",
"merchant_id": "1549901"
}
}'
{
"response": {
"reverse_status": "approved",
"order_id": "test_12343242111",
"response_description": "",
"response_code": "",
"merchant_id": 1549901,
"response_status": "success",
"signature": "c703b3ce82aecfd2de633319685223347140717d",
"reverse_id": "",
"reversal_amount": "1",
"transaction_id": "2011273408"
}
}
{
"response": {
"error_code": 1007,
"error_message": "Parameter `signature` is incorrect",
"request_id": "HGh7ami3WN0ci",
"response_status": "failure"
}
}