Refund/Cancellation of payment (Refund)

Refund  request is to be used for making of assets refund or cancellation of payment.

Refund of assets can be performed through personal account M-portal  or through usage of API – Refund method.

Request parameters:

The request with required parameters is to be formed on the side of merchant and to be transferred by POST method through HTTP protocol to URL https://api.wayforpay.com/api

 

PARAMETER

DESCRIPTION

MANDATORY

transactionType

Type of request takes the value REFUND

yes

merchantAccount

Seller identifier

yes

orderReference

Unique number of the order in merchant’s system

yes

amount

Amount of refund

yes

currency

Currency of order: UAH

yes

comment

Merchant  Comment, Description reversal reason. UTF-8 Encoding

yes

merchantSignature

Signature of the request

yes

apiVersion

The protocol version. Default value: 1

 

productName[]

Array with the names of ordered productsemail@mail.com

no

productPrice[]

Array with the prices per product units, This information will be visible at the page of payment for order

no

productCount[]

Array with the quantity of ordered products on each item.

no

 

For the purposes of confirmation of data validity there should be generated and transferred in the request the HMAC_MD5 control signature using SecretKey of merchant.

The line which subjects to HMAC_MD5 is generated through catenation of parameters  merchantAccount, orderReference, amount, currency divided with “;” (semi-column) in coding UTF-8

Response parameters:

 

PARAMETER

DESCRIPTION

MANDATORY

merchantAccount

Seller identifier

yes

orderReference

Unique number of the order in merchant’s system

yes

transactionStatus

Refund status. It may contain the following values:

- Refunded,Voided

- Declined

yes

reason

Reason for refusal

yes

reasonCode

Code of refusal

yes

Request parameters in response gateway WayForPay

For the purposes of confirmation of data validity there should be generated and transferred in the request the HMAC_MD5 control signature using SecretKey of merchant.

The line which subjects to HMAC_MD5 is generated through catenation of parameters  merchantAccount, orderReference, transactionStatus, reasonCode  divided with “;” (semi-column) in coding UTF-8

 

An example of request and response

Request:
{
"transactionType":"REFUND",
"merchantAccount":"test_merchant",
"orderReference":"DH783023",
"amount":100,
"currency":"UAH",
"comment":"Нет в наличии товара",
"merchantSignature":"b95932786cbe243a76b014846b63fe92",
"apiVersion": 1
}
Response:
{
"orderReference":"DH783023",
"transactionStatus":"refunded",
"reasonCode":1100,
"reason":"ok",
"merchantAccount":"test_merchant"
}