Transaction API
The Transaction API allows you to manage payment transaction operations such as retrieving transaction history, viewing transaction details, sending email receipts, voiding transactions, and processing refunds.
List Transactions
Retrieves a list of transactions with optional filtering parameters.
GET /api/v2/order
Authorization: Bearer {jwt}
Accept: application/jsonParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | true | Bearer Token |
| createdStart | query | string(date) | false | Start date for filtering |
| createdEnd | query | string(date) | false | End date for filtering |
| transactionId | query | string | false | Transaction ID filter |
| acquirerRefNo | query | string | false | Acquirer reference number |
| deviceId | query | string | false | Terminal device ID |
| pageSize | query | number | false | Default 10, use -1 to query all |
| pageNumber | query | number | false | Default 1 |
| settleState | query | number | false | Settlement state (see details below) |
| state | query | number | false | Transaction state (see details below) |
Transaction States
-
settleState:
- 0: WAIT_FOR_SETTLE
- 1: SETTLED
- 2: SETTLE_FAILED
-
state:
- 0: INIT
- 1: PROCESSING
- 2: APPROVED
- 3: DECLINED
- 4: VOIDED
- 5: REFUNDED
- 6: CLOSED
- 7: REVERSED
Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens in a new tab) | Success | Wrapper: Response<T> |
Example Response (200)
{
"msg": "SUCCESS",
"code": 0,
"data": {
"total": 25,
"current": 1,
"records": [
{
"tranId": "T20230615123456",
"amount": {
"currency": "USD",
"value": 1000
},
"approvalCode": "123456",
"batchNo": "001",
"cvmPerformed": "NO_CVM",
"appName": "Visa",
"linkedTranId": "",
"mchName": "Demo Merchant",
"tsi": "E800",
"acqTid": "10001234",
"rrn": "123456789012",
"tc": "ABCD1234EFGH5678",
"tranStatus": "APPROVED",
"tranType": "SALE",
"atc": "001A",
"tvr": "0000000000",
"trace": "000123",
"acqMid": "123456789012345",
"accountMasked": "************1234",
"sdkId": "SDK-123456",
"paymentMethod": "VISA",
"hostMessageFormat": "ISO8583",
"aid": "A0000000031010",
"entryMode": "CONTACTLESS"
}
],
"hasNext": true
}
}Get Transaction Details
Retrieves detailed information for a specific transaction.
GET /api/v2/order/{transactionId}
Authorization: Bearer {jwt}
Accept: application/jsonParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | true | Bearer Token |
| transactionId | path | string | true | Transaction ID |
Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens in a new tab) | Success | Wrapper: Response<T> |
Example Response (200)
{
"msg": "SUCCESS",
"code": 0,
"data": {
"tranId": "T20230615123456",
"approvalCode": "123456",
"cvmPerformed": "NO_CVM",
"tsi": "E800",
"tranStatus": "APPROVED",
"tranType": "SALE",
"atc": "001A",
"trace": "000123",
"acqMid": "123456789012345",
"callbackUrl": "https://merchant.example.com/callback",
"entryMode": "CONTACTLESS",
"amount": {
"currency": "USD",
"value": 1000
},
"batchNo": "001",
"appName": "Visa",
"linkedTranId": "",
"mchName": "Demo Merchant",
"acqTid": "10001234",
"rrn": "123456789012",
"tc": "ABCD1234EFGH5678",
"tvr": "0000000000",
"accountMasked": "************1234",
"sdkId": "SDK-123456",
"paymentMethod": "VISA",
"hostMessageFormat": "ISO8583",
"actions": [
{
"tranId": "T20230615123456",
"actionType": "SALE",
"reason": "",
"amount": {
"currency": "USD",
"value": 1000
},
"trace": "000123",
"actionStatus": "APPROVED",
"hostRespCode": "00",
"actionId": "A123456789"
}
],
"aid": "A0000000031010"
}
}Send Receipt Email
Sends a transaction receipt to the specified email address.
POST /api/v2/order/email/{transactionId}
Content-Type: application/json
Authorization: Bearer {jwt}Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | true | Bearer Token |
| transactionId | path | string | true | Transaction ID |
| body | string | true | Email recipient address |
Request Body Example
{
"email": "[email protected]"
}Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens in a new tab) | Success | Wrapper: Response<T> |
Example Response (200)
{
"msg": "SUCCESS",
"code": 0
}Void Transaction
Voids (cancels) a previously approved sale or refund transaction.
POST /api/v2/order/void/{transactionId}
Content-Type: application/json
Authorization: Bearer {jwt}Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | true | Bearer Token |
| transactionId | path | string | true | Transaction ID |
| adminPwd | body | string | true | Admin password for authorization |
Request Body Example
{
"adminPwd": "123456"
}Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens in a new tab) | Success | Wrapper: Response<T> |
Example Response (200)
{
"msg": "SUCCESS",
"code": 0,
"data": {
"currency": "USD",
"state": 2,
"deviceId": "9d6064fb550e484d",
"refundAmount": 2
}
}Process Refund
Issues a refund for a previously completed transaction. Supports partial refunds.
POST /api/v2/order/refund/{transactionId}
Content-Type: application/json
Authorization: Bearer {jwt}Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | true | Bearer Token |
| transactionId | path | string | true | Transaction ID |
| refundAmount | body | number | true | Amount to refund (can be less than original transaction) |
| refundReason | body | string | true | Reason for the refund |
| adminPwd | body | string | true | Admin password for authorization |
Request Body Example
{
"refundAmount": 500,
"refundReason": "Customer request",
"adminPwd": "123456"
}Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens in a new tab) | Success | Wrapper: Response<T> |
Example Response (200)
{
"msg": "SUCCESS",
"code": 0,
"data": {
"id": 12345
}
}Process Capture
Issues a capture for a previous auth transaction. Supports partial amount, but also need acquire support it.
POST /api/v2/order/capture/{transactionId}
Content-Type: application/json
Authorization: Bearer {jwt}Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | true | Bearer Token |
| transactionId | path | string | true | Transaction ID |
| amount | body | string | false | Amount to capture (can be less than original transaction) |
Request Body Example
{
"amount": "500"
}Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens in a new tab) | Success | Wrapper: Response<T> |
Example Response (200)
{
"msg": "SUCCESS",
"code": 0,
"data": {
}
}