Skip to main content

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 NameRequiredDescription
AuthorizationYesBearer {AccessToken}
Content-TypeYesapplication/json

Request Body

FieldTypeRequiredDescription
referenceCodestringYesReference code of the transaction to be cancelled
reasonstringNoCancellation reason (e.g.: "User request")
{
"referenceCode": "NTH2P00000003000",
"reason": "test cancel"
}

data Fields

FieldTypeDescription
lastAmountnumberRemaining amount after cancellation (typically 0.00 for successful cancellation)
transactionStatusIdintCurrent transaction status
errorCodestring/nullError code
errorMessagestring/nullError message
isSuccessbooleanWhether 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 reason field 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).