Dealer Payment Cancellation
- Endpoint:
/vpws/payment/cancel - 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 enables the cancellation of a payment transaction previously performed via VPWS.
Cancellation
- Can only be performed for successful (
transactionStatusId = 1) transactions. - Is performed via
referenceCode. - May result in success or failure depending on the bank provision status.
Note: A dealer can only cancel 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 cancelled |
| reason | string | No | Cancellation reason (e.g.: "User request") |
- Example Request
- Successful Response
{
"referenceCode": "NTH2P00000003000",
"reason": "test cancel"
}
{
"message": "",
"statusCode": 200,
"exceptions": null,
"data": {
"lastAmount": 0.0,
"transactionStatusId": 1,
"errorCode": null,
"isSuccess": true,
"errorMessage": null
},
"oldData": null,
"errors": null
}
data Fields
| Field | Type | Description |
|---|---|---|
lastAmount | number | Remaining amount after cancellation (typically 0.00 for successful cancellation) |
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/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {AccessToken}' \
--data '{
"referenceCode": "NTH2P00000003000",
"reason": "test cancel"
}'
Notes & Best Practices
-
Cancellation can only be performed on successful transactions.
-
If a cancellation call is made again with the same
referenceCode, the system may behave idempotently. -
Cancellation may not be possible for transactions whose bank provision period has expired.
-
Filling in the
reasonfield is recommended for reporting purposes. -
Transaction status should be verified after cancellation via the 3.4 – Transaction Query service.
-
A dealer cannot cancel transactions belonging to another dealer (
403 – Authorization Error).