API FONDYVersion 1.0

Request parameters

ParameterTypeDescriptionExample
order_idstring(1024)Order ID which is generated by merchant.

mandatory
ID1234
merchant_idinteger(12)Merchant unique ID. Generated by FONDY during merchant registration.

mandatory
1
signaturestring(40)Order signature. Required to verify merchant request consistency and authenticity. Signature generation algorithm please see at Signature generation for request and response

mandatory
1773cf135bd89656131134b98637894dad42f808
versionstring(10)Protocol version.

Default value: 1.0
1.0
amountinteger(12)Reversal amount

mandatory
1020 (EUR)
means 10 euros and 20 cents
currencystring(3)Order currency. Supported values:
UAH — Ukrainian Hryvnia
RUB — Russian Rouble
USD — US Dollar
GBP — Pound sterling
EUR — Euro

mandatory
USD
commentstring(1024)Merchant comment on reversal reason UTF-8“Customer returned product back”

Response parameters

ParameterTypeDescriptionExample
order_idstring(1024)Order ID which is generated by merchant.ID1234
merchant_idinteger(12)Merchant unique ID. Generated by FONDY during merchant registration.1
revers_statusstring(50)Reversal processing status. Can contain next values:
created — reversal has been created, but not processed yet
declined — reversal is declined by FONDY payment gateway or by bank or by external payment system
approved — reversal completed successfully
approved
response_statusstring(50)Request processing status. If parameters sent by merchant did not pass validation then failure, else success 
signaturestring(40)Order signature. Required to verify merchant request consistency and authenticity. Signature generation algorithm please see at Signature generation for request and response
1773cf135bd89656131134b98637894dad42f808
response_codeinteger(4)Response decline code1008
response_descriptionstring(1024)Response decline reasonParameter `amount` is mandatory

Parameters of response in case of error

See Parameters of response in case of error

Request generation

Reversal request always generated by merchant using host-to-host request to URL https://api.fondy.eu/api/reverse/order_id

Host-to-host API supports the following text formats:

Response is always returned in request context in the same content-type. So if request is sent in JSON, response will be sent in JSON format too.

Example host-to-host JSON

Content Type: application/json

Request

{
   "request":{
      "order_id":"test7926651365",
      "currency":"USD",
      "amount":"1",
      "merchant_id":"1",
      "signature":"b1ed592ff76ddca287503b11c1aad70bb1c67f37"
   }
}

Normal response

{
   "response":{
      "order_id":"test309906285",
      "response_status":"success",
      "response_code":"",
      "reverse_status":"approved",
      "response_description":"",
      "merchant_id":"1"
   }
}

Response in case of error

{
   "response":{
      "response_status":"failure",
      "error_message":"Order Not Found",
      "error_code":"1018"
   }
}

Example host-to-host XML

Content Type: application/xml

Request

<?xml version="1.0" encoding="UTF-8"?>
<reqest>
   <order_id>test7926651365</order_id>
   <currency>USD</currency>
   <amount>1</amount>
   <merchant_id>1</merchant_id>
   <signature>b1ed592ff76ddca287503b11c1aad70bb1c67f37</signature>
</request>

Normal response

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <order_id>test6622534987</order_id>
   <response_status>success</response_status>
   <response_code />
   <reverse_status>approved</reverse_status>
   <response_description />
   <merchant_id>1</merchant_id>
</response>

Response in case of error

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <response_status>failure</response_status>
   <error_message>Order Not Found</error_message>
   <error_code>1018</error_code>
</response>

Example host-to-host HTML form

Content Type: application/x-www-form-urlencoded

Request

order_id=test6622534987&currency=USD&amount=1&merchant_id=1
&signature=6ccbfeb82894b5c51855e032da1e7a3bee65f3a3

Normal response

order_id=test7101250216&response_status=success&response_code=
&reverse_status=approved&response_description=&merchant_id=1

Response in case of error

response_status=failure&error_message=Order+Not+Found&error_code=1018

Connect to FONDY and learn more!