Cancel - API Credit Card
About Cancel - API Credit Card
This API uses by Merchant to cancel the paid transaction.
If You cancel before the settlement process is complete, then the transaction is considered Void and the transaction funds will be returned to your Customer. However, cancellations after the settlement process is complete are included in the Refund category.
Please visit Credit Card Transaction Settlement page to find out more about the terms Void or Refund.
Cancel - API Credit Card
The Credit Card Cancel API uses to cancel the process of payments via Credit Card.
API End Point | /nicepay/direct/v2/cancel |
|---|---|
Request Method | POST |
Header | Content-Type: application/json |
Merchant Token | SHA256(timeStamp+iMid+tXid+amt+merchantKey) |
Request Parameters for Cancel - API Credit Card
The following is a list of request parameters in the Cancel Credit Card API to process cancel transactions for Credit Card payment methods. This parameters uses through the API testing platform.
Parameter | Type | Size | Description | Example / Notes |
|---|---|---|---|---|
timeStamp Required | N | 14 | API Request Timestamp | 20221214111239 |
tXid Required | AN | 30 | Transaction ID | IONPAYTEST01202212141146401456 |
iMid Required | AN | 10 | Merchant ID | IONPAYTEST |
payMethod Required | N | 2 | 01 | |
cancelType Required | N | 2 | | 2 |
merchantToken Required | AN | 255 | Merchant token | ff139e49606387091cd9baeadff3161aff6afd9406e1f481e0fdb8b46d1ae5ae |
referenceNo | ANS | 40 | Reference Number | ordNo20221214111208 |
amt Required | N | 12 | Payment Amount | 1000 |
cancelMsg | AN | 255 | Cancel Message | Cancellation Of Transaction Credit Card |
cancelServerIp | AN | 15 | Server IP | 127.0.0.1 |
cancelUserId | AN | 30 | User ID | Admin |
cancelUserIp | AN | 15 | User IP | 127.0.0.1 |
cancelUserInfo | AN | 100 | User Information | Test Cancel |
cancelRetryCnt | N | 2 | Retry Count | 5 |
cancelReferenceNo Optional For CC | AN | 40 | Merchant Cancel Number | ordNo20221214111208 |
worker | AN | 10 | Worker | Worker |
Response Parameter for Cancel - API Credit Card
The following is a list of Response Parameter or the result from the Request Parameter for Credit Card cancel handling:
Parameter | Type | Size | Description | Example / Notes |
|---|---|---|---|---|
resultCd | N | 4 | Result Code | 0000 |
resultMsg | AN | 255 | Result Message: Error Code | SUCCESS |
tXid | AN | 30 | Transaction ID | IONPAYTEST01202212141146401456 |
referenceNo | ANS | 40 | Merchant Order Number | ordNo20221214111208 |
transDt | N | 8 | Transaction Date | 20221214 |
transTm | N | 6 | Transaction Time | 114640 |
amt | N | 12 | Amount | 5000 |
cancelReferenceNo Optional For CC | AN | 40 | Merchant Cancel Number | ordNo20221214111208 |
acquirerData Only For CC | Array | 20 | A dynamic array consisting of a unique reference number RRN that is provided by the Banking Partner when a refund is processed. This reference number can be used by the Customer to track the status of the refund with the Bank. | "acquirerData": { "rrn":"332608321717" } |
Sample Parameter for Cancel - API Credit Card
Request Parameter
$config = $this->configV2;
$timestamp = "20251008131011";
$txId = "IONPAYTEST01202509241944339756";
$amount = "10000";
$reffNo = "OrdNo20250924194433";
$requestBody = Cancel::builder()
->setTimeStamp($timestamp)
->setIMid($this->iMid)
->setTXid($txId)
->setReferenceNo($reffNo)
->setMerchantToken($timestamp, $this->iMid, $txId, $amount, $this->merchantKey)
->setPayMethod("01")
->setCancelType("2")
->setAmt($amount)
->setCancelReferenceNo("OrdNo20250924194433")
->build();
$v2VaService = new V2VAService($config);
$response = $v2VaService->cancel($requestBody);
Response Parameter
{
"tXid": "IONPAYTEST01202509241944339756",
"referenceNo": "OrdNo20250924194433",
"resultCd": "0000",
"resultMsg": "SUCCESS",
"transDt": "20250924",
"transTm": "194433",
"description": "This is testing transaction",
"amt": "10000",
"cancelReferenceNo": "OrdNo20250924194433",
"acquirerData": {
"rrn": null
}
}