This endpoint initiates the refund request from the merchant:
HTTP Method | Post | Note: |
---|---|---|
URL (UAT) | Note: | |
URL (Production) | Note: |
Request Parameters
*Abbreviations: NU - Numeric, CH – Character, AN – Alphanumeric
Field Name | Description | Required | Type | Min | Max | Example |
---|---|---|---|---|---|---|
PAY_ID | Pay ID is a unique merchant identifier provided by Pay10 | YES | NU | 16 | 16 | 160234578452178 |
ORDER_ID | Merchant reference number | YES | AN | 1 | 50 | PAY10_823647263 |
AMOUNT | Total Sale Amount | YES | NU | 3 | 12 | 100 |
CURRENCY_CODE | 3-digit code of the currency | YES | NU | 3 | 3 | 356 |
TXNTYPE | Type of Transaction | YES | AN | 2 | 10 | STATUS |
PG_REF_NUM | Id generated by Pay10. Use for further communication with Pay10 for tracking the full order | YES | NU | 16 | 16 | 150611417421129 |
REFUND_FLAG | R is a refund flag | YES | CH | 1 | 1 | Y |
REFUND_ORDER_ID | Generated during refund | YES | AN | 6 | 20 | REFUNDID0108323811 |
This is an example string of a payment request before it is hashed:
{ORDER_ID=PAY10_144644225~REFUND_FLAG=R~AMOUNT=100~PG_REF_NUM=1879120328175249~REFUND_ORDER_ID=REFUND_ID01042218323811~CURRENCY_CODE=784~TXNTYPE=REFUND~PAY_ID=100912012518012}
Now use AES256 Encryption to encrypt the above string.
This is the expected result of the hash value:
ENCDATA=KMlw0myCSYz3ILnhUrzNlF5logncK7o82XTqXUf/b/5l+271u87tVNPl5PrcVYv3VyoqMiodQ57IwFV2bY+4PhWElrH2jdAwaMdVE0ICnvSlnINP5lXGwrLNP5INziM3SCfYuU7ne/AFaUYZ2R5GPEnkJyx31ysbwuiU+UvB0urzvERc0R/nXE9iJ3uAVxVUudNkLwxG4IiJMUuFaS6pj4YsyUu2k6O1OT00oPbNQeU=
Final Request String:
{"PAY_ID":"1009120125180122","ENCDATA":"KMlw0myCSYz3ILnhUrzNlF5logncK7o82XTqXUf/b/5l+271u87tVNPl5PrcVYv3VyoqMiodQ57IwFV2bY+4PhWElrH2jdAwaMdVE0ICnvSlnINP5lXGwrLNP5INziM3SCfYuU7ne/AFaUYZ2R5GPEnkJyx31ysbwuiU+UvB0urzvERc0R/nXE9iJ3uAVxVUudNkLwxG4IiJMUuFaS6pj4YsyUu2k6O1OT00oPbNQeU="}
After posting a created request a response is received
Receive Decrypted Response:
{"PAY_ID":"1009120125180122","ENCDATA":"KMlw0myCSYz3ILnhUrzNlF5logncK7o82XTqXUf/b/5l+271u87tVNPl5PrcVYv3VyoqMiodQ57IwFV2bY+4PhWElrH2jdAwaMdVE0ICnvSlnINP5lXGwrLNP5INziM3SCfYuU7ne/AFaUYZ2R5GPEnkJyx31ysbwuiU+UvB0urzvERc0R/nXE9iJ3uAVxVUudNkLwxG4IiJMUuFaS6pj4YsyUu2k6O1OT00oPbNQeU="}
Now Again AES256 will be used to decrypt the response.
Refund Status
This endpoint will be used to get the status of the refund initiated:
HTTP Method | Post | Note |
---|---|---|
URL (UAT) | Note: | |
URL (Production) | Note: |
Request Parameters
*Abbreviations: NU - Numeric, CH – Character, AN – Alphanumeric
Field Name | Description | Required | Type | Min | Max | Example |
---|---|---|---|---|---|---|
PAY_ID | Pay ID is a unique merchant identifier provided by Pay10 | Yes | NU | 16 | 16 | 160234578452178 |
ORDER_ID | Merchant reference number | YES | AN | 1 | 50 | PAY10_823647263 |
REFUND_ORDER_ID | Generated during refund | YES | AN | 6 | 20 | REFUNDID0108323811 |
This is an example string of a payment request before it is hashed:
{ORDER_ID=37170171~PAY_ID=1009120902164952~REFUND_ORDER_ID=3213132313213}
Now append salt at the end of the string.
{ORDER_ID=37170171~PAY_ID=1009120902164952~REFUND_ORDER_ID=32131323132131518b6433cc24337}
After completing the above-mentioned process, you will have to call SHA 256 algorithm and pass the parameter string to the same and the SHA will return you the desired result as below.
This is the expected result of the hash value:
Hash value = A08FD314FDDF5B14A304EC978600AAEF03C92ACE86FD06982C61B5056FC07DFC
This is the expected final post request:
{"PAY_ID": "1102111026150307", "ORDER_ID": "37170171", "REFUND_ORDER_ID": "20221212174211",
"HASH": "6797F1842DEB4F3EBAEAD53E1BAFD5A535D322B9FA3893F201FDB03933EEAE09"}
Now, the response one will receive if data found:
{RESPONSE_DATE_TIME=2023-03-25 10:44:54, RESPONSE_CODE=000, REFUND_FLAG=R,MOP_TYPE=1027, PG_TXN_MESSAGE=SUCCESS, STATUS=Captured, PG_REF_NUM=5179120325104453, AMOUNT=100, RESPONSE_MESSAGE=SUCCESS, REFUND_ORDER_ID=20221212174211, RRN=ARI3790714,ACQ_ID=ARI3790714, TXNTYPE=REFUND, SURCHARGE_FLAG=Y, PAYMENT_TYPE=NB, PAY_ID=1102111026150307, ORDER_ID=37170171}
And the response one will receive if data not found:
{ PAY_ID=1102111026150307, ORDER_ID=37170171, RESPONSE_CODE=300, RESPONSE_MESSAGE=NO DATA FOUND, REFUND_ORDER_ID=20221212174212, HASH=7CAB90F17E7C7CE664EB6823E3DC38F44B7CF5E7876697D5E0B025AEF2563E7E}
Response Code for Valid Refund Transaction
Response Code | Message | Status |
---|---|---|
004 | Refund Declined/ payment Declined/ Transaction Declined | Declined |
007 | Refund Rejected / payment Rejected / Transaction Rejected | Rejected |
013 | Total refund amount greater than sale amount | REFUND_REJECTED |
014 | Refund Amount should be less than today's Captured Amount | REFUND_DENIED |
016 | In case of Full Refund, Refund Amount shall be equal to the Sale Amount | REFUND_FLAG_AMOU NT_NOT_MATCH |
022 | Refund Failed/ Payment Failed/ Transaction Failed | Failed at Acquirer |
000 | Pending | REFUND_INITIATED |
000 | SUCCESS | Captured |