Refund Create
Request URL
HTTP
https://{{gateway_domain}}/pg/v2/refund/createRequest Parameters
HTTP Method
POST
HTTP Header
| Field | Data Type | Length Limit | Required | Description |
|---|---|---|---|---|
| Content-Type | String | N/A | YES | This field value only supports application/json. |
| Accept | String | N/A | YES | This field value only supports application/json. |
| Authorization | String | YES | Authorization: {type} {credentials}, refer to the Signature specification |
HTTP Body
| Field | Data Type | Length Limit | Required | Description |
|---|---|---|---|---|
| merchantRefundNo | String | 50 | YES | Merchant-generated refund order number. Uniqueness is recommended. |
| paymentNo | String | 50 | YES | Payment platform transaction number corresponding to the original payment order. |
| amount | String | 18 | YES | Refund amount. Integer part 1-15 digits with 2 decimals, e.g. "100.05". |
| description | String | 80 | YES | Refund description, used to explain the reason for the refund. |
Response Data
HTTP Header
| Field | Data Type | Required | Description |
|---|---|---|---|
| Content-Type | String | YES | This field value only supports application/json. |
| Authorization | String | YES | Authorization: {type} {credentials}, refer to the Signature specification |
HTTP Body
| Field | Data Type | Required | Description |
|---|---|---|---|
| code | String | YES | Response status code |
| errorMessage | String | NO | Error message |
| data | JSON Object | NO | Response data |
Description of data field
| Field | Data Type | Required | Description |
|---|---|---|---|
| refundNo | String | YES | Refund platform transaction number |
| paymentNo | String | YES | Original payment transaction number |
| merchantRefundNo | String | YES | Merchant refund order number |
| amount | String | YES | Refund amount |
| currency | String | YES | Refund currency |
Examples
Request
HTTP
curl https://{{gateway_domain}}/pg/v2/refund/create \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H 'Authorization: V2_SHA256 appId=1111b620f93b48c5904210ff47bb1111,sign=9e494e8a91bcdd08f18ad5b2cfdbfd5654f5c00c89f8216eebd7c1637b6ce01b,timestamp=1714128828114,nonce=C7CA27DC6D55DA935DFC8450C721CC99' \
-d '{
"merchantRefundNo": "REFUND-001",
"paymentNo": "20240423220624300800001097000004",
"amount": "50.00",
"description": "User requested refund"
}'Response
HTTP
HTTP/1.1 200 OK
Content-Type: application/json
Server: nginx/1.18.0
Date: Mon, 06 Mar 2024 12:00:00 GMT
Authorization: V2_SHA256 appId=1111b620f93b48c5904210ff47bb1111,sign=ac6ae72f8c46f5c2092c3dab9bb0e08b6cdb6d5e7ff8ad190499a8955d57f297,timestamp=1714128245401,nonce=28FA11BF8FD1309767551B4FD8A57BD5
{
"code": "OK",
"errorMessage": null,
"data": {
"refundNo": "20240423220624300800001097000005",
"paymentNo": "20240423220624300800001097000004",
"merchantRefundNo": "REFUND-001",
"amount": "50.00",
"currency": "INR"
}
}