Order Reversal

This endpoint allows merchants to reverse an order by sending a host-to-host request. The request can be made in JSON, XML, or HTML FORM format, and the response will be returned in the same format.

POST/reverse/order_id

This endpoint allows merchants to reverse an order by sending a host-to-host request. The request can be made in JSON, XML, or HTML FORM format, and the response will be returned in the same format.

Header Parameters

Content-Typestringrequired

Specifies the format for the request. Response will be in the same format.

Body application/json

requestobject
Show request properties
order_idstringrequired

A unique identifier for the order. This can be any value defined by the merchant, allowing you to use any internal order identification system your business employs.

merchant_idintegerrequired

A unique identifier assigned to the merchant by Fondy upon account registration. This ID is required for authenticating requests and associating transactions with the merchant’s account.

signaturestringrequired

Signature for request verification, generated according to Fondy’s algorithm. Required to verify merchant request consistency and authenticity. Learn how to use Fondy’s algorithm at the Signature Generation for Request and Response page.

versionstring

Specifies the protocol version to use for the reversal request. Default is ‘1.0’ for compatibility with the current API structure.

amountintegerrequired

The total amount to be reversed, specified in minor currency units (e.g., cents). For example, 1020 in EUR represents 10 euros and 20 cents. Separators or decimal points aren’t allowed.

currency"AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SVC" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VEF" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWD"required

Currency for the transaction (e.g., GBP, EUR, USD). Refer to the Currencies page for a full list of available currencies.

commentstring

A comment provided by the merchant to explain the reason for the reversal. The comment must be in UTF-8 format and should describe the context of the reversal.

Response

Order reversal response in the requested format (JSON, XML, or HTML FORM).

responseobject
Show response properties
order_idstring

A unique identifier for the order. This can be any value defined by the merchant, allowing you to use any internal order identification system your business employs.

merchant_idinteger

A unique identifier assigned to the merchant by Fondy upon account registration. This ID is required for authenticating requests and associating transactions with the merchant’s account.

revers_status"created" | "declined" | "approved"

The status of the reversal processing. Indicates whether the reversal request has been successfully created, declined, or approved.

response_statusstring

The status of the request processing. Returns 'success' if the request validation passes, or 'failure' if there are errors in the request.

signaturestring

Signature for request verification, generated according to Fondy’s algorithm. Required to verify merchant request consistency and authenticity. Learn how to use Fondy’s algorithm at the Signature Generation for Request and Response page.

response_codeinteger

A numeric code representing the response outcome. If the request fails, this field provides a decline code indicating the specific error.

response_descriptionstring

A detailed description of the response, especially in the case of a decline. Explains the reason for the failure or any additional details about the request outcome.

Request
curl -X POST "https://pay.fondy.eu/api/reverse/order_id" \
  -H "Content-Type: application/json" \
  -H "Content-Type: <Content-Type>" \
  -d '{
  "request": {
    "order_id": "ORDER_12345678",
    "merchant_id": 1,
    "signature": "1773cf135bd89656131134b98637894dad42f808",
    "version": "1.0",
    "amount": 1020,
    "currency": "AED",
    "comment": "Customer returned product back."
  }
}'
Response
{
  "response": {
    "order_id": "ORDER_12345678",
    "merchant_id": 1,
    "revers_status": "approved",
    "response_status": "success",
    "signature": "1773cf135bd89656131134b98637894dad42f808",
    "response_code": 1008,
    "response_description": "Parameter `amount` is mandatory."
  }
}