5. Refund interface
This XML-interface enables Merchant to cancel transaction and return funds to Client.
Action - https://api.paysoft.solutions/merchants/refund
Method - POST
XML-request format:
<Command>
<LMI_MERCHANT_ID></LMI_MERCHANT_ID>
<LMI_SYS_PAYMENT_ID></LMI_SYS_PAYMENT_ID>
<RefundId></RefundId>
<ActionAmount></ActionAmount>
<RefundAmount></RefundAmount>
<LMI_HASH></LMI_HASH>
</Command>
Name | XML-format | Description | |
---|---|---|---|
Merchant ID | LMI_MERCHANT_ID | Merchant’s POS ID which received a payment from Client. | |
Internal payment number in PaySoft system | LMI_SYS_PAYMENT_ID | ||
Unique refund request number | RefundId | Refund request number is a unique one in LMIMERCHANT_ID. It may content a letters of Roman alphabet, figures, signs “-" and "" (without inverted commas; a line can’t begin from signs). Maximum lenth of the number - 20 symbols. | |
Total payment amount | ActionAmount | ||
Cancellation amount | RefundAmount | Refund amount must be less or equal to full amount of payment. Some payment systems support partial payment refunds. | |
Signature of request | LMI_HASH | Yes | The signature of the request is generated by hashing the original text of the XML request with an empty LMI\ _HASH value and the SecretKey using the algorithm specified in the Merchant Cabinet. The received signature is passed in the LMI_HASH tag. The recommended encryption algorithm is SHA256. Sign example |
XML-response format:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Retval></Retval>
<Retdesc></Retdesc>
<Retdata>
<ResultCode></ResultCode>
<ResultMsg></ResultMsg>
</Retdata>
</Response>
Name | XML-format | Description |
---|---|---|
Operation code of request | Retval | 1 (one) – successful transaction |
Description of operation code | Retdesc | |
Refund code | Retdata/ResultCode | |
Description of refund code | Retdata/ResultMsg |
NOTE! Unlike other interfaces and forms, refund interface has 2 statuses (operation codes). Operation code of request (Retval) indicates successful or unsuccessful refund request, while refund result code (Retdata/ResultCode) indicates successful refunds in payment system.
In case of receiving a non-final response in field Retdata/ResultCode it’s possible to make another request with the same parameters (necessarily with the same RefundId) to get a status of the processed request.
Codes of refund operations
Code | Explanation | Final/non-final |
---|---|---|
600 | Refund was successful | Final |
601 | Transaction not found | Final |
602 | Refund is possible only for successful transactions | Final |
603 | Refund time is over | Final |
604 | Invalid payment amount | Final |
605 | Invalid refund amount | Final |
606 | Refund amount cannot exceed full amount of payment | Final |
607 | Refund operation is being processed | Non-final |
608 | Transaction is already refunded | Final |
609 | Payment system doesn’t support refunds | Final |
610 | Payment system doesn’t support partial refunds | Final |
618 | Invalid ID refund | Final |