Dealer Payment Refund
- Endpoint:
/vpws/payment/refund - HTTP Method:
POST - Request Content-Type:
application/json - Response Content-Type:
application/json - Authorization: Valid AccessToken required.
(See: 2. Authentication – Obtaining AccessToken)
Description
This service provides full or partial refund of a payment transaction previously performed via VPWS.
Refund
- Can only be performed for successful (
transactionStatusId = 1) transactions. - Is performed via
referenceCode. - May result in success or failure depending on bank provision rules.
Note: A dealer can only create refund requests for transactions they have performed.
Header Information
| Header Name | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer {AccessToken} |
| Content-Type | Yes | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| referenceCode | string | Yes | Reference code of the transaction to be refunded |
| amount | decimal | No | Amount to be refunded. If not sent, full refund is performed |
| reason | string | No | Refund reason (e.g.: "Product return") |
Scenarios
- Full Refund:
amountfield is not sent. The entire transaction amount is refunded. - Partial Refund:
amountfield is sent. Refund is made for the specified amount.
- Example Request (Partial Refund)
- Successful Response
{
"referenceCode": "NTH2P00000002974",
"amount": 15,
"reason": "test refund"
}
{
"message": null,
"statusCode": 200,
"exceptions": null,
"data": {
"lastAmount": 235.00,
"transactionStatusId": 6,
"errorCode": null,
"errorMessage": null,
"isSuccess": true
},
"oldData": null,
"errors": null
}
data Fields
| Field | Type | Description |
|---|---|---|
lastAmount | number | Remaining amount after refund |
transactionStatusId | int | Current transaction status |
errorCode | string/null | Error code |
errorMessage | string/null | Error message |
isSuccess | boolean | Whether the operation was successful |
Example cURL
curl --location 'https://pgw.netahsilatdemo.com/vpws/payment/refund' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {AccessToken}' \
--data '{
"referenceCode": "NTH2P00000002974",
"amount": 15,
"reason": "test refund"
}'
Notes & Best Practices
-
The
amountvalue cannot exceed the transaction amount. -
Multiple partial refunds can be made for the same transaction; the total refund amount cannot exceed the transaction amount.
-
Refund may not be possible for transactions that have exceeded the bank refund period (e.g., 30 days).
-
Refund requests cannot be created for incomplete or failed transactions.
-
Current status after refund should be verified via the 3.4 – Transaction Query service.
-
A dealer can only apply refunds to their own transactions.