Abort
ENDPOINT
POST
https://open.sunbay.us/v1/semi-integration/transaction/abortThe Transaction Abort interface is used to abort unpaid transactions. When calling this interface, the terminalSn parameter must be provided to specify the payment terminal. The abort request will be pushed to the specified payment terminal, and the interface returns immediately, indicating that the request has been successfully issued (does not mean the abort is complete). After the payment terminal receives the request, it will attempt to abort the processing flow of this transaction. Important: After the abort request, it does not mean the transaction is cancelled. The final result depends on the terminal's processing result. The abort result is obtained through asynchronous notification or active query.
Parameters
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Y | Bearer Token authentication, format: Bearer {your_api_key} Example: "Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" |
Content-Type | string | Y | Request content type, fixed value: application/json |
X-Client-Request-Id | string(64) | Y | Request unique identifier, used to prevent duplicate requests and issue tracking. UUID format is recommended, each request must use a unique Request ID Example: "550e8400-e29b-41d4-a716-446655440000" |
X-Timestamp | string | Y | Request timestamp, Unix timestamp (milliseconds), 13 digits. The deviation between the request timestamp and server time cannot exceed ±10 minutes Pattern: ^[0-9]{13}$Example: "1701234567890" |
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
appId | string(32) | Y | Application ID Example: "app_123456" |
merchantId | string(32) | Y | Merchant ID Example: "mch_789012" |
originalTransactionId | string(64) | N | SUNBAY Nexus transaction ID of the original transaction to be aborted. Use either this or originalTransactionRequestId. If both are provided, originalTransactionId takes priority Example: "TXN20231119001" |
originalTransactionRequestId | string(32) | N | Transaction request ID of the original transaction to be aborted. Use either this or originalTransactionId. If both are provided, originalTransactionId takes priority Example: "PAY_REQ_20231119001" |
terminalSn | string(32) | Y | Payment terminal serial number. The serial number of the payment terminal provided by SUNBAY, which is used for reading bank cards, processing PINs, and other security operations Example: "T1234567890" |
description | string(128) | N | Abort reason description Example: "Customer cancelled payment" |
attach | string(128) | N | Additional data, returned as is, JSON format recommended Example: "{\"reason\":\"customer_cancel\"}" |
Request Example
{
"appId": "app_123456",
"merchantId": "mch_789012",
"originalTransactionId": "TXN20231119001",
"originalTransactionRequestId": "PAY_REQ_20231119001",
"terminalSn": "T1234567890",
"description": "Customer cancelled payment"
}Code Examples
cURLbash
Response parameters
| Name | Type | Required | Description |
|---|---|---|---|
code | string(16) | Y | Response code, 0 indicates success Example: "0" |
msg | string(128) | N | Response description Example: "Transaction aborted" |
traceId | string(64) | Y | Trace ID for troubleshooting Example: "TRACE123456789" |
data | object | Y |
Last updated on