---
title: Cancel - API Convenience Store
slug: en/nicepay-api-non-snap-cancel-api-convenience-store
description: Information about Non-SNAP Payment API - Cancel - Convenience Store API available on NICEPAY system
image: https://archbee-image-uploads.s3.amazonaws.com/ZHvSjR5ZrsoxwKbJa3xmo/wrT5q--4KE7j09WTkv5ta_microsoftteams-image.png
icon: {"faIcon":"fa-solid fa-book"}
docTags: 
createdAt: 2022-12-01T07:51:47.000Z
---

# About API Convenience Store Cancel

***

This API uses by Merchants to integrate the cancel system for Convenience Store's payment method used by the Merchant. Transaction cancellation happens from either the Customer side or the Merchant.

1. If the Customer changes their mind after proceeding with the order and requests cancellation from the Merchant before proceeding with the payment process.
2. If there is a technical or non-technical issue when the Merchant processes the Customer's order.

Merchants can use this API so that the payment number issue can't be used anymore.

:::hint{type="warning"}
Payment number **can only canceled&#x20;**&#xA0;before being paid before the payment process is executed. 

If the Customer has proceeded with the payment process, the paid bill can't be canceled or refunded to the Customer through API.
:::



# API Convenience Store Cancel

***

The Convenience Store Cancel API uses for the cancel system for payments through Convenience Store.

| **API End Point**  | `/nicepay/direct/v2/cancel`                           |
| ------------------ | ----------------------------------------------------- |
| **Request Method** | <font color="#3b9f0f">**POST**</font>****             |
| **Header**         | `Content-Type: application/json`                      |
| **Merchant Token** | SHA256(`timeStamp`+`iMid`+`tXid`+`amt`+`merchantKey`) |
| **Request Format** | `application/json`                                    |



# Payment Methods Available for Cancel

***

**Code              PayMethod**

***

`01`               Credit Card

***

`02`               Virtual Account

***

`03`               <font color="#2166ae">**Convenience Store**</font>****

***

`04`               Direct Debit&#x20;

***

`05`               E-Wallet

***

`06`               Paylater

***

`08`               QRIS&#x20;

***

`09`               GPN&#x20;

***



## Request Parameters for Convenience Store Cancel

***

The following is a list of parameters for activating the cancel system for the Convenience Store payment method. These parameters use via the API testing platform.

| **Parameter**                                               | **Type** | **Size** | **Description**                                                                            | **Example / Notes**                                              |
| ----------------------------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
| `timeStamp`<br /> <font color="#2166ae">Required</font>     | N        | 14       | API Request Timestamp <font color="#2166ae"></font>                                       | 20221212101278                                                   |
| `tXid`<br /> <font color="#2166ae">Required</font>          | AN       | 30       | Transaction ID<br /><font color="#2166ae"></font>&#xD;                                    | IONPAYTEST03202212121030529316                                   |
| `iMid`<br /> <font color="#2166ae">Required</font>          | AN       | 10       | Merchant ID<br /><font color="#2166ae"></font>&#xD;                                       | IONPAYTEST                                                       |
| `payMethod`<br /> <font color="#2166ae">Required</font>     | N        | 2        | [Payment Method Code](docId\:NQ1y7vMa25ZtvQHN5He6W) <font color="#2166ae"></font>&#xD;    | 03                                                               |
| `cancelType`<br /> <font color="#2166ae">Required</font>    | N        | 2        | [Cancel Type Code](docId\:VNHGJOXcH1WJMHnlKYVOC) <br /><font color="#2166ae"></font>&#xD; | 1                                                                |
| `cancelMsg`                                                 | AN       | 255      | Cancel Message                                                                             | Request Cancel                                                   |
| `merchantToken`<br /> <font color="#2166ae">Required</font> | AN       | 255      | Merchant Token <br /><font color="#2166ae"></font>                                        | 49974dde3c4a311030bd2095431443ce3689d79c90caaa88f4186050abb77cf9 |
| `amt`<br /> <font color="#2166ae">Required</font>           | N        | 12       | Payment Amount <br /><font color="#2166ae"></font>&#xD;                                   | 10000                                                            |
| `preauthToken`                                              | AN       | 100      | Pre-Auth Token&#xD;                                                                        | -                                                                |



## Response Parameters for Convenience Store Cancel

***

Following are the response parameters from the results of the request parameters for the integration of the Convenience Store ancel:

| **Parameter** | **Type** | **Size** | **Description**                                                                                                              | **Example / Notes**                 |
| ------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| `resultCd`    | N        | 4        | [Result Code](docId:9eC3yH9CQqpb6cRWauWWO) [&#xD;](https://app.archbee.com/docs/36sM2OxRIwwbi9iNlqMTP/wpcEMaZro_Xvnxz-1ZAiB) | 0000                                |
| `resultMsg`   | AN       | 255      | Result Message: [Error Code](docId\:FsX1GESJKxOp0T9rvUHp_)&#xD;                                                              | SUCCESS                             |
| `tXid`        | AN       | 30       | Transaction ID&#xD;                                                                                                          | IONPAYTEST03202212121030529316&#xD; |
| `referenceNo` | ANS      | 40       | Merchant Order Number&#xD;                                                                                                   | 815123412341&#xD;                   |
| `transDt`     | N        | 8        | Transaction Date&#xD;                                                                                                        | 20221212&#xD;                       |
| `transTm`     | N        | 6        | Transaction Time                                                                                                             | 103052&#xD;                         |
| `description` | AN       | 255      | Description                                                                                                                  | test cancel&#xD;                    |
| `amt`         | N        | 12       | Amount                                                                                                                       | 10000&#xD;                          |



## Response Parameter for Convenience Store Cancel&#x20;

***

:::CodeblockTabs
JSON Request

```json
{
	"timeStamp":"20221212101278",
	"tXid":"IONPAYTEST03202212121030529316",
	"iMid":"IONPAYTEST",
	"payMethod":"03",
	"cancelType":"1",
	"cancelMsg":"Request Cancel",
	"merchantToken":"49974dde3c4a311030bd2095431443ce3689d79c90caaa88f4186050abb77cf9",
	"preauthToken":"",
	"amt":"10000"
}
```

JSON Response

```json
{
    "tXid": "IONPAYTEST03202212121030529316",
    "referenceNo": "815123412341",
    "resultCd": "0000",
    "resultMsg": "SUCCESS",
    "transDt": "20221212",
    "transTm": "103052",
    "description": "test cancel",
    "amt": "10000"
}
```

Java Request

```java
//Cancel Registration//
nicePay.setTimeStamp("20221208091279");
nicePay.setiMid("IONPAYTEST");
nicePay.setAmt("5");
nicePay.setMerchantToken(nicePay.makeToken(nicePay.getMerchantToken());
nicePay.settXid("IONPAYTEST08202212080951090538");
nicePay.setPayMethod("03");
nicePay.setCancelType("1");
nicePay.setCancelMsg("Request Cancel");



// Request Cancel
nicePay.cancel();

// Response String //
System.out.println("Final Response String : " + nicePay.getResponseString());

String resultCd = nicePay.Get("resultCd");
String resultMsg = nicePay.Get("resultMsg");
String tXid = nicePay.Get("tXid");
String referenceNo = nicePay.Get("referenceNo");
String amt = nicePay.Get("amt");
String cancelReferenceNo = nicePay.Get("cancelReferenceNo");
```
:::

