The Refund API is only required if the merchant wants to refund a transaction. The refund API is the most commonly used and is a must have if you intend on building an administration panel.
The process of the Refund API is real simple and straight forward. Below demonstrates the steps required in order to successfully make the request.
HTTP is used as the request-response protocol between a merchants site and the eCOMM API. In the back end, a merchant submits a HTTP POST request to the eCOMM server, the server will then return an XML document where the merchant must parse the data inside and act accordingly. The response contains key information about the request and also contains the requested content.
The request string that is sent for the `Refund` call must be composed of the following information:The above parameters are required when sending HTTP POST data to our API in order to receive a successful response. The data parameter must be composed using our Available Form Data fields.
Below is a table containing all the available fields for passing POST data into the data parameter within the `Refund` request. The value you enter for the Amount field must not exceed the total used in the sale request as the request will fail.
FieldName | Description | Required | FieldDefinition |
---|---|---|---|
R1 |
Transaction Code.
The Transaction Code used in the Sale request. |
Y | AN(40) |
R2 |
Amount To Refund (Without Decimals).
E.g: €100.00 = [10000], €123.67 = [12367], €0.99 = [99]. |
Y |
N(20) |
R3 |
Reason For Refund.
Please choose from the reasons below and use the number associated with the reason: Visa:
|
Y | AN(50) |
R4 | Vendor ID | Y | AN(50) |
R5 | Notification URL | Y | AN(2000) |
Below is a table containing all the available fields for the data parameter within the `Refund` request including its validation. These are used when constructing the data.
FieldName | Description | Validation |
---|---|---|
R1 | Transaction Code | ^[-_0-9A-Za-z]{0,40}$ |
R2 | Amount To Refund | ^[0-9]{0,20}$ |
R3 | Reason For Refund | From list of reasons |
R4 | Vendor ID | ^[a-zA-Z0-9 ,'._-]{0,50}$ |
R5 | Notification | https?:\/\/?[-a-zA-Z0-9@:%._\+\~#=]{2,256}\b([-a-zA-Z0-9@:;%_\+.\~#?*\[\]{}()<>!&\/=]*) |
The below sample demonstrates what is expected when passing POST data into the data parameter.
When forming the data parameter, please refer to our guidelines above.
Below are the expected XML fields returned from the request.
FieldName | Description | FieldDefinition |
---|---|---|
R1 |
Error Code
Please see Appendix A for a list of available error codes. |
N(4) |
R2 |
Description
Please see Appendix A for a list of descriptions. |
AN(250) |
This section demonstrates the expected XML document responses returned from the HTTP POST once the request has passed validations.
The below indicates a successful refund notification, expected to return to the Notification URL.