--- url: >- https://acquirer-api-docs-v4-en.pingpongx.com/en/notes/api/services/InPersonPayments/gmc/transactionCancel/index.md description: >- The GMC serial transaction cancel interface is used to cancel transactions in progress. It communicates with POS devices through serial ports and cancels transactions based on merchant transaction ID. It adopts SHA256 signature to ensure data security and is suitable for scenarios such as user cancellation of payment, transaction timeout, etc. --- # GMC Serial Transaction Cancel Interface ```apidef endpoint: POST /onsiteAcquirer/gmc/transactionCancel name: GMC Serial Transaction Cancel Interface ``` The GMC serial transaction cancel interface is used to cancel transactions in progress. It communicates with POS devices through serial ports and cancels transactions based on merchant transaction ID. It adopts SHA256 signature to ensure data security and is suitable for scenarios such as user cancellation of payment, transaction timeout, etc. ## Request Parameters | Parameter | Type | Required | Description | |--------|------|------|------| | accId | string | M | Unique store identifier for the merchant in PingPong system | | clientId | string | M | PingPong merchant ID | | signType | string | M | Supports SHA256; for details, see the Signature Specification: /en/notes/guide/sign/ section of this document | | sign | string | M | Request signature, all parameters participate in signing, see Signature Specification: /en/notes/guide/sign/ | | version | string | M | Protocol version, currently 1.0 | | event | string | M | Event type, enum values: PAY - Payment; REFUND - Refund; PAY_QUERY - Transaction Query; REFUND_QUERY - Refund Query; CALCULATE - Settlement; REPRINT - Reprint; TRANSACTION_CANCEL - Transaction Cancel; HEARTBEAT - Heartbeat; | | requestTime | string | M | Request timestamp (milliseconds) | | bizContent | string | M | Business parameters JSON string, all request parameters except common request parameters must be passed within this parameter | | └─ merchantTransactionId | string | M | Merchant transaction ID | ### Request Example ```json { "accId": "PPX_ACC_202312001", "clientId": "PPX_MCH_20230001", "signType": "SHA256", "sign": "9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08", "version": "1.0", "event": "TRANSACTION_CANCEL", "requestTime": "1683532500000", "bizContent": "{\"merchantTransactionId\":\"MCH_ORDER_20231212001\"}" } ``` ## Response Parameters | Parameter | Type | Description | |--------|------|------| | accId | string | Unique store identifier for the merchant in PingPong system | | clientId | string | PingPong merchant ID | | signType | string | Supports SHA256; for details, see the Signature Specification: /en/notes/guide/sign/ section of this document | | sign | string | Response signature, all parameters participate in signing, see Signature Specification: /en/notes/guide/sign/ | | event | string | Event type, response enum values: PAY_ACCEPTANCE - Payment order acceptance; PAY_QUERY_RESULT - Payment query result; REFUND_ACCEPTANCE - Refund order acceptance; REFUND_QUERY_RESULT - Refund query result; | | requestTime | string | Merchant-side request time. Timestamp, to the millisecond | | code | string | Result status code, see the appendix Status Code Table: /en/notes/appendix/successCodeList/. The following are specific to POS serial port transactions: 0 - Acceptance success; -1 - Acceptance failure; 901001 - Transaction blocked, a transaction is already being processed; | | description | string | Result description | | bizContent | string | Business response parameters, JSON string | | └─ requestId | string | Unique request ID | | └─ merchantTransactionId | string | Merchant transaction ID | | └─ transactionId | string | PingPong transaction ID | | └─ status | string | Cancel status: SUCCESS - Success; FAILED - Failed; | ### Response Example ```json { "accId": "PPX_ACC_202312001", "clientId": "PPX_MCH_20230001", "signType": "SHA256", "sign": "9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08", "version": "1.0", "event": "TRANSACTION_CANCEL", "code": "0", "description": "取消受理成功", "requestTime": "1683532501000", "bizContent": "{\"requestId\":\"REQ_202312120001\",\"merchantTransactionId\":\"MCH_ORDER_20231212001\",\"transactionId\":\"PPX_TXN_202312120001\",\"status\":\"SUCCESS\"}" } ```