Reversal/Cancel
How to Reverse/Cancel a Payment?
To Reverse/ Cancel the transaction you have to send the paymentType as RV.
The paymentID has to be send with a POST request over HTTPS to the /transactionServices/REST/v1/payments/{id} endpoint.
You can cancel previous payments and a cancelation is allowed against preauthorized payment types.
Request specification.
| Parameter | Description | Format | Required |
|---|---|---|---|
| authentication.memberId | Unique merchant member ID provided by TWPayz. | N10 [0-9]{1,10} |
Yes |
| authentication.checksum | MD5 checksum generated using merchant credentials for request authentication. | AN32 [a-fA-F0-9]{32} |
Yes |
| paymentType | Request to inquire the detail information of the previously placed transaction. | A2 ((CP)) |
Yes |
| paymentId | Unique transaction reference generated by the merchant. | AN1024 [a-zA-Z0-9\\p{Space}\\-_.]{1,1024} |
Yes |
Response specification.
| Parameter | Description | Format | Required |
|---|---|---|---|
| paymentId | Unique payment identifier generated by TWPayz. | N10 [0-9] |
Yes |
| result.code | Response code indicating the transaction status. | AN11 [0-9\.]{2,11} |
Yes |
| result.description | Description corresponding to the response code. | AN255 [a-zA-Z0-9\\p{Space}\\,]+[a-zA-Z0-9\\p{Space}\\,]+ |
Yes |
| timestamp | Shows at what time the transaction has been placed. | date yyyy-MM-dd hh:mm:ss |
Yes |
Sample Request

Sample Response

Hashing Rule
TWPayz is supporting MD5 Cryptographic Hash for the authenticity of payment request send to the server.
Below are the description of fields used for generating checksum:
- memberId <Merchant ID as shared by TWPayz>
- secureKey <Secure Key that can be generated through TWPayz's dashboard>
- paymentId <Id of previous transaction>
How to generate Checksum?
Checksum has to be calculated with following combination & needs to be send along with the authentication parameters in each server-to-server request:
Cancel Payment:
<memberId>|<secureKey>|<paymentId>
Sample Code
