Download OpenAPI specification:Download
The API used for online payment by Spiral Checkout
The API call for transaction operation, includes Sale, SaleSession, Auth, AuthSession, Capture and Refund
clientId required | string Example: merchantOne The ID of the account assigned by Spiral |
merchantRef required | string Example: 1627965086558-1 The reference created by merchants on this order, must be unique. |
Spiral-Request-Datetime | string Example: 2021-08-03T04:31:26.558Z The UTC time in %Y-%m-%d'T'%H:%M:%S'Z' format when the request/response is composed |
Spiral-Client-Signature | string Example: KsUJDwropdIGZ/G6vVEXG4FiEOw/+u6dzeuYaFCxnulnJp9vrhyxP0wj0HxzXx/EQyOD6qq5VJFlFvw0Cez1/qnwpoQPHONOE0aQLcxFcEa7TpIU33Ihy3z0lMSRq5xVreuYSawRQi1kVOpVPtLPPBRbk/hYc1NqzQ/gVnwTgHOkP8Cuk4G2e1mV0sq7GISNcvilvOWGoD6DT0Qpln1Tz76ttEn+9dzAzq8G0dLAI2Xp7fJhKGjQNR+aaWibqq8x+FJFafZpFpMP835QUsZmcC740oV/nL2O0LpDpCrTGd5VjIBQa7hJ3q0m4MtEqiWKfTdQ1gZM6FJ+eFzS72qEOw== Signature of the client |
clientId required | string The ID of the account assigned by Spiral |
merchantRef required | string The reference created by merchants on this order, must be unique. |
cmd required | string indication of the operation SALE / AUTH / SALESESSION / AUTHSESSION |
type required | string transaction type, details refer to the Support Types page. |
amt required | number transaction amount |
goodsName required | string Goods title |
goodsDesc | string Description of Goods |
channel | string To indicate the channel of the payment, should be APP or WEB in requst |
cardToken | string Only be submitted for direct payment as a substitution of the card numbers. Need to provide the cardTokenSrc at the same time. |
cardTokenSrc | string The source of the card tokens, must be used with cardToken. Can be SPIRAL, APPLE_PAY, GOOGLE_PAY |
successUrl | string <uri> The page to be redirect on the browser when payment completed successfully |
failureUrl required | string <uri> The page to be redirect on the browser when payment did not complete successfully |
webhookUrl required | string <uri> The endpoint of the payment result notification |
metadata | string A json object that contains the user defined data. The data will not be used for the authorization or any other operation of the payment. It will be stored in the database and be further used for reporting or query. |
duration | number number of days the qrCode will be valid (should be only used by the FPS bill payment sending via mail) |
{- "clientId": "merchantOne",
- "merchantRef": "Order-1001",
- "cmd": "SALE",
- "type": "VM",
- "amt": 100.5,
- "goodsName": "Sunmi T2 Lite",
- "goodsDesc": "Electronic product",
- "channel": "WEB",
- "cardToken": "ABCDEF1234567890",
- "cardTokenSrc": "SPIRAL",
- "metadata": {
- "orderId": "162836528",
- "activityDateTime": "2021-08-03T04:31:26",
- "customerId": "David"
}, - "duration": 30
}
{- "dateTime": "string",
- "clientId": "testAccount",
- "merchantRef": "Order-1001",
- "cmd": "SALE",
- "orderId": "0c170aa0-7c5a-4b32-9529-102aaa454f51",
- "type": "VM",
- "txnId": "5fe3368b-453a-4cc1-81f1-4c2054cb4ca4",
- "txnType": "SALE",
- "merchantId": "H345678H3620000",
- "hostId": "1",
- "card": "VISA",
- "status": "Approved",
- "amt": 100.5,
- "resp": "APPROVED",
- "hostTime": "2021-02-03T17:29:09+08:00",
- "appCode": "123456",
- "pan": "444000xxxxxx0010",
- "expDate": "1027",
- "respMsg": "ok",
- "goodsName": "Sunmi T2 Lite",
- "goodsDesc": "Electronic product",
- "cardToken": 4444555566667777,
- "cardTokenSrc": "SPIRAL",
- "metadata": {
- "orderId": "162836528",
- "activityDateTime": "2021-08-03T04:31:26",
- "customerId": "David"
}, - "paidAmt": 100.5,
- "orderAmt": 100.5,
- "currency": "HKD"
}
The API call for query transaction status
clientId required | string Example: merchantOne The ID of the account assigned by Spiral |
merchantRef required | string Example: 1627965086558-1 The reference created by merchants on this order, must be unique. |
Spiral-Request-Datetime | string Example: 2021-08-03T04:31:26.558Z The UTC time in %Y-%m-%d'T'%H:%M:%S'Z' format when the request/response is composed |
Spiral-Client-Signature | string Example: KsUJDwropdIGZ/G6vVEXG4FiEOw/+u6dzeuYaFCxnulnJp9vrhyxP0wj0HxzXx/EQyOD6qq5VJFlFvw0Cez1/qnwpoQPHONOE0aQLcxFcEa7TpIU33Ihy3z0lMSRq5xVreuYSawRQi1kVOpVPtLPPBRbk/hYc1NqzQ/gVnwTgHOkP8Cuk4G2e1mV0sq7GISNcvilvOWGoD6DT0Qpln1Tz76ttEn+9dzAzq8G0dLAI2Xp7fJhKGjQNR+aaWibqq8x+FJFafZpFpMP835QUsZmcC740oV/nL2O0LpDpCrTGd5VjIBQa7hJ3q0m4MtEqiWKfTdQ1gZM6FJ+eFzS72qEOw== Signature of the client |
{- "dateTime": "string",
- "clientId": "testAccount",
- "merchantRef": "Order-1001",
- "cmd": "SALE",
- "orderId": "0c170aa0-7c5a-4b32-9529-102aaa454f51",
- "type": "VM",
- "txnId": "5fe3368b-453a-4cc1-81f1-4c2054cb4ca4",
- "txnType": "SALE",
- "merchantId": "H345678H3620000",
- "hostId": "1",
- "card": "VISA",
- "status": "Approved",
- "amt": 100.5,
- "resp": "APPROVED",
- "hostTime": "2021-02-03T17:29:09+08:00",
- "appCode": "123456",
- "pan": "444000xxxxxx0010",
- "expDate": "1027",
- "respMsg": "ok",
- "goodsName": "Sunmi T2 Lite",
- "goodsDesc": "Electronic product",
- "cardToken": 4444555566667777,
- "cardTokenSrc": "SPIRAL",
- "metadata": {
- "orderId": "162836528",
- "activityDateTime": "2021-08-03T04:31:26",
- "customerId": "David"
}, - "paidAmt": 100.5,
- "orderAmt": 100.5,
- "currency": "HKD"
}
The API call for creating a payment link from gateway
clientId required | string Example: merchantOne The ID of the account assigned by Spiral |
merchantRef required | string Example: 1627965086558-1 The reference created by merchants on this order, must be unique. |
Spiral-Request-Datetime | string Example: 2021-08-03T04:31:26.558Z The UTC time in %Y-%m-%d'T'%H:%M:%S'Z' format when the request/response is composed |
Spiral-Client-Signature | string Example: KsUJDwropdIGZ/G6vVEXG4FiEOw/+u6dzeuYaFCxnulnJp9vrhyxP0wj0HxzXx/EQyOD6qq5VJFlFvw0Cez1/qnwpoQPHONOE0aQLcxFcEa7TpIU33Ihy3z0lMSRq5xVreuYSawRQi1kVOpVPtLPPBRbk/hYc1NqzQ/gVnwTgHOkP8Cuk4G2e1mV0sq7GISNcvilvOWGoD6DT0Qpln1Tz76ttEn+9dzAzq8G0dLAI2Xp7fJhKGjQNR+aaWibqq8x+FJFafZpFpMP835QUsZmcC740oV/nL2O0LpDpCrTGd5VjIBQa7hJ3q0m4MtEqiWKfTdQ1gZM6FJ+eFzS72qEOw== Signature of the client |
clientId required | string The ID of the account assigned by Spiral |
merchantRef required | string The reference created by merchants on this order, must be unique. |
amt required | number transaction amount |
goodsName required | string Goods title |
goodsDesc | string Description of Goods |
webhookUrl required | string <uri> The endpoint of the payment result notification |
durationHr required | number number of hours the payment link will be valid |
{- "clientId": "merchantOne",
- "merchantRef": "Order-1001",
- "amt": 100.5,
- "goodsName": "Sunmi T2 Lite",
- "goodsDesc": "Electronic product",
- "durationHr": 24
}
{- "clientId": "testAccount",
- "merchantRef": "Order-1001",
- "approvedTxnId": "5fe3368b-453a-4cc1-81f1-4c2054cb4ca4",
- "status": "Unconfirmed",
- "amt": 100.5,
}
The API call for query payment link status
clientId required | string Example: merchantOne The ID of the account assigned by Spiral |
merchantRef required | string Example: 1627965086558-1 The reference created by merchants on this order, must be unique. |
Spiral-Request-Datetime | string Example: 2021-08-03T04:31:26.558Z The UTC time in %Y-%m-%d'T'%H:%M:%S'Z' format when the request/response is composed |
Spiral-Client-Signature | string Example: KsUJDwropdIGZ/G6vVEXG4FiEOw/+u6dzeuYaFCxnulnJp9vrhyxP0wj0HxzXx/EQyOD6qq5VJFlFvw0Cez1/qnwpoQPHONOE0aQLcxFcEa7TpIU33Ihy3z0lMSRq5xVreuYSawRQi1kVOpVPtLPPBRbk/hYc1NqzQ/gVnwTgHOkP8Cuk4G2e1mV0sq7GISNcvilvOWGoD6DT0Qpln1Tz76ttEn+9dzAzq8G0dLAI2Xp7fJhKGjQNR+aaWibqq8x+FJFafZpFpMP835QUsZmcC740oV/nL2O0LpDpCrTGd5VjIBQa7hJ3q0m4MtEqiWKfTdQ1gZM6FJ+eFzS72qEOw== Signature of the client |
{- "clientId": "testAccount",
- "merchantRef": "Order-1001",
- "approvedTxnId": "5fe3368b-453a-4cc1-81f1-4c2054cb4ca4",
- "status": "Unconfirmed",
- "amt": 100.5,
}
The API call for querying a list of the transactions within the time range for reconciliations purpose. Only processed transactions will be returned.
clientId required | string The ID of the account assigned by Spiral |
Spiral-Request-Datetime | string Example: 2021-08-03T04:31:26.558Z The UTC time in %Y-%m-%d'T'%H:%M:%S'Z' format when the request/response is composed |
Spiral-Client-Signature | string Example: KsUJDwropdIGZ/G6vVEXG4FiEOw/+u6dzeuYaFCxnulnJp9vrhyxP0wj0HxzXx/EQyOD6qq5VJFlFvw0Cez1/qnwpoQPHONOE0aQLcxFcEa7TpIU33Ihy3z0lMSRq5xVreuYSawRQi1kVOpVPtLPPBRbk/hYc1NqzQ/gVnwTgHOkP8Cuk4G2e1mV0sq7GISNcvilvOWGoD6DT0Qpln1Tz76ttEn+9dzAzq8G0dLAI2Xp7fJhKGjQNR+aaWibqq8x+FJFafZpFpMP835QUsZmcC740oV/nL2O0LpDpCrTGd5VjIBQa7hJ3q0m4MtEqiWKfTdQ1gZM6FJ+eFzS72qEOw== Signature of the client (no merchantRef such payload is constructed from clientId & time) |
dateTimeStart required | string The UTC time in %Y-%m-%d'T'%H:%M:%S'Z' format when the request/response is composed |
dateTimeEnd required | string The UTC time in %Y-%m-%d'T'%H:%M:%S'Z' format when the request/response is composed |
limit | integer The maximum number of transactions return in a single message, default value is 50 and the maximum limit is 100 |
nextToken | string The value is returned in previous query and used for pagination. Do not include this field in the first query. |
{- "dateTimeStart": "2022-03-02T08:00:00Z",
- "dateTimeEnd": "2021-03-03T08:00:00Z",
- "limit": 100,
- "nextToken": "{\"merchantRef\": \"1676337454148\", \"clientId\": \"hebbe\", \"dateTime\": \"2021-08-03T09:17:44Z\"}"
}
{- "clientId": "testAccount",
- "nextToken": "{\"merchantRef\": \"1676337454100\", \"clientId\": \"hebbe\", \"dateTime\": \"2021-08-00T08:17:44Z\"}",
- "dateTime": "2023-03-03 11:34:06+0800",
- "txns": [
- {
- "dateTime": "2023-03-03 11:33:10+0800",
- "clientId": "eftit",
- "cmd": "SALESESSION",
- "txnType": "SALE",
- "type": "PAYME",
- "orderId": "beac7f26-5b09-45b2-938a-84465c9225fa",
- "txnId": "d76d57f0-43bc-4165-a3c7-5dec8a2f7b28",
- "merchantId": "cbfb84ac-127e-4ec2-af79-5532eab2f5b0",
- "merchantRef": "1677811441941",
- "gatewayRef": "1677811441941",
- "card": "PAYME",
- "status": "Approved",
- "resp": "001",
- "pan": "ff00000000000000000001",
- "currency": "HKD",
- "amt": 0.81,
- "paidAmt": 0.81,
- "goodsName": "Test Product",
- "hostId": "16",
- "hostTime": "2023-03-03T03:33:12Z",
- "sessionId": "PMDd76d57f0eftit+1677811441941"
}, - {
- "dateTime": "2023-03-03 11:33:14+0800",
- "clientId": "eftit",
- "cmd": "SALESESSION",
- "txnType": "SALE",
- "type": "PAYME",
- "orderId": "166856a2-7a66-4c46-9e6e-aa5e00e78fcf",
- "txnId": "7d4cd34e-5ac6-42fe-980e-7c0f23273b4a",
- "merchantId": "cbfb84ac-127e-4ec2-af79-5532eab2f5b0",
- "merchantRef": "1677814392912",
- "gatewayRef": "1677814392912",
- "card": "PAYME",
- "status": "Approved",
- "resp": "001",
- "pan": "ff00000000000000000003",
- "currency": "HKD",
- "amt": 0.81,
- "paidAmt": 0.81,
- "goodsName": "Test Product",
- "hostId": "16",
- "hostTime": "2023-03-03T03:33:15Z",
- "sessionId": "PMD7d4cd34eeftit+1677814392912"
}
]
}
The webhook to notify merchant on the transaction result
transactionWebhookURL required | string The URL specified in the sale request |
Spiral-Request-Datetime | string Example: 2021-08-03T04:31:26.558Z The UTC time in %Y-%m-%d'T'%H:%M:%S'Z' format when the request/response is composed |
Spiral-Server-Signature | string Example: KsUJDwropdIGZ/G6vVEXG4FiEOw/+u6dzeuYaFCxnulnJp9vrhyxP0wj0HxzXx/EQyOD6qq5VJFlFvw0Cez1/qnwpoQPHONOE0aQLcxFcEa7TpIU33Ihy3z0lMSRq5xVreuYSawRQi1kVOpVPtLPPBRbk/hYc1NqzQ/gVnwTgHOkP8Cuk4G2e1mV0sq7GISNcvilvOWGoD6DT0Qpln1Tz76ttEn+9dzAzq8G0dLAI2Xp7fJhKGjQNR+aaWibqq8x+FJFafZpFpMP835QUsZmcC740oV/nL2O0LpDpCrTGd5VjIBQa7hJ3q0m4MtEqiWKfTdQ1gZM6FJ+eFzS72qEOw== Signature of the Server |
dateTime | string transaction date time in YY-MM-DD hh:mm:ss+0800 format |
clientId required | string The ID of the account assigned by Spiral |
merchantRef required | string The reference created by merchants on this order, must be unique. |
cmd required | string indication of the operation |
orderId required | string <uuid> generated by Spiral, reference for an order |
type required | string transaction type, details refer to the Support Types page. |
txnId required | string <uuid> generated by Spiral, if a refund to made to a sale transaction, the OrderID will be the same with a new TxnID |
txnType | string Transaction type, SALE/AUTH/CAPTURE/REFUND |
merchantId required | string Merchant ID of the payment acquirer |
hostId required | string indicator ID of the payment acquirer |
card | string card type |
status required | string Status of the transaction |
amt required | number transaction amount |
resp | string Response Code from the payment acquirer |
hostTime required | string <date-time> The transaction time from the payment system |
appCode | string Approval code |
pan | string Card PAN in truncated format. |
expDate | string Expiry date. Usually in truncated format. |
respMsg | string Response Message (Text) from the payment system |
goodsName | string Goods title for eComm |
goodsDesc | string Description of Goods that will be an indication to payment or discount calculation or shown as info in eComm |
cardToken | string Only be submitted for direct payment as a substitution of the card numbers. Need to provide the cardTokenSrc at the same time. |
cardTokenSrc | string The source of the card tokens, can be SPIRAL, APPLE_PAY, GOOGLE_PAY |
metadata | string A json object that contains the user defined data. The data will not be used for the authorization or any other operation of the payment. It will be stored in the database and be further used for reporting or query. |
paidAmt required | number Amount paid (It should be identical to amt except FPS) |
orderAmt | number Total amount paid for this order, only available for FPS |
currency | string payment currency |
{- "dateTime": "string",
- "clientId": "testAccount",
- "merchantRef": "Order-1001",
- "cmd": "SALE",
- "orderId": "0c170aa0-7c5a-4b32-9529-102aaa454f51",
- "type": "VM",
- "txnId": "5fe3368b-453a-4cc1-81f1-4c2054cb4ca4",
- "txnType": "SALE",
- "merchantId": "H345678H3620000",
- "hostId": "1",
- "card": "VISA",
- "status": "Approved",
- "amt": 100.5,
- "resp": "APPROVED",
- "hostTime": "2021-02-03T17:29:09+08:00",
- "appCode": "123456",
- "pan": "444000xxxxxx0010",
- "expDate": "1027",
- "respMsg": "ok",
- "goodsName": "Sunmi T2 Lite",
- "goodsDesc": "Electronic product",
- "cardToken": 4444555566667777,
- "cardTokenSrc": "SPIRAL",
- "metadata": {
- "orderId": "162836528",
- "activityDateTime": "2021-08-03T04:31:26",
- "customerId": "David"
}, - "paidAmt": 100.5,
- "orderAmt": 100.5,
- "currency": "HKD"
}
The webhook to notify merchant on the payment link result
paymentLinkWebhookURL required | string The URL specified in the sale request |
Spiral-Request-Datetime | string Example: 2021-08-03T04:31:26.558Z The UTC time in %Y-%m-%d'T'%H:%M:%S'Z' format when the request/response is composed |
Spiral-Server-Signature | string Example: KsUJDwropdIGZ/G6vVEXG4FiEOw/+u6dzeuYaFCxnulnJp9vrhyxP0wj0HxzXx/EQyOD6qq5VJFlFvw0Cez1/qnwpoQPHONOE0aQLcxFcEa7TpIU33Ihy3z0lMSRq5xVreuYSawRQi1kVOpVPtLPPBRbk/hYc1NqzQ/gVnwTgHOkP8Cuk4G2e1mV0sq7GISNcvilvOWGoD6DT0Qpln1Tz76ttEn+9dzAzq8G0dLAI2Xp7fJhKGjQNR+aaWibqq8x+FJFafZpFpMP835QUsZmcC740oV/nL2O0LpDpCrTGd5VjIBQa7hJ3q0m4MtEqiWKfTdQ1gZM6FJ+eFzS72qEOw== Signature of the Server |
clientId required | string The ID of the account assigned by Spiral |
merchantRef required | string The reference created by merchants on this order, must be unique. |
approvedTxnId required | string the txnId of the approved transaction of the payment link |
status required | string Status of the transaction |
amt required | number transaction amount |
paymentLinkUrl required | string payment link URL |
{- "clientId": "testAccount",
- "merchantRef": "Order-1001",
- "approvedTxnId": "5fe3368b-453a-4cc1-81f1-4c2054cb4ca4",
- "status": "Unconfirmed",
- "amt": 100.5,
}