Query Transaction
Process
Merchant calls this API to retrieve order information and transaction status.
API Information
Method: GET
URL:
Request
Main Parameters
| No | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | request_id | String(100) | ✅ | Unique request ID |
| 2 | request_time | String(20) | ✅ | Request send time. Format: YYYY-MM-DD H:i:s |
| 3 | master_merchant_code | String(50) | ✅ | Unique identifier for master merchant |
| 4 | sub_merchant_code | String(50) | ✅ | Unique identifier for sub merchant |
| 5 | order_code | String(50) | ✅ | Baokim order code from Authentication step |
Example Request
{
"request_id": "MERCHANT050015588AXE014",
"request_time": "2020-08-11 14:41:00",
"master_merchant_code": "MASTER_MERCHANT",
"sub_merchant_code": "SUB_MERCHANT",
"order_code": "VLAD_1753867524"
}
Response
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | code | Number(3) | ✅ | Baokim error code |
| 2 | message | String(200) | ✅ | Baokim error message |
| 3 | data | Object | ✅ | Data returned by Baokim |
Data Information(3)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | order_code | String | ✅ | Baokim order code |
| 2 | amount | Number | ✅ | Order amount |
| 3 | status | Number | ✅ | Order status |
| 4 | created_at | Datetime | ✅ | Creation time |
| 5 | updated_at | Datetime | ✅ | Update time |
| 6 | steps | Object | ✅ | Steps history |
Steps Information(6)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | authentication | Object | ✅ | Authentication step information |
| 2 | authorize | Array | ✅ | Array of Authorization transactions |
| 3 | capture | Array | ✅ | Array of Capture transactions |
| 4 | refund | Array | ❌ | Array of Refund transactions |
| 5 | reversal | Array | ❌ | Array of Reversal transactions |
| 6 | void | Array | ❌ | Array of Void transactions |
Authentication Information(1)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | authen_status | Number | ✅ | Card authentication status: 0 = Pending, 1 = Authenticated, 2 = Failed, 3 = Bypass |
| 2 | authen_amount | Number | ✅ | Authentication amount |
| 3 | request_time | String(20) | ✅ | Request time. Format: YYYY-MM-DD H:i:s |
| 4 | card | Object | ✅ | Card token needed for UCOF payment |
| 5 | url_success | String(255) | ✅ | Baokim redirect URL on successful authentication |
| 6 | url_fail | String(255) | ✅ | Baokim redirect URL on failed authentication |
| 7 | off_3ds | Number | ❌ | 3DS disabling request? 0 = No, 1 = Yes |
| 8 | 3ds_url | String(255) | ✅ | 3DS link |
| 9 | extend | Object | ❌ | Extended data |
Authorize Information(2)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | authorize_status | Number | ✅ | Authorization status: 0 = Pending, 1 = Authorized, 2 = Fail |
| 2 | authorize_amount | Number | ✅ | Amount |
| 3 | request_time | String(20) | ✅ | Request time. Format: YYYY-MM-DD H:i:s |
| 4 | authorize_type | Number | ✅ | Authorization type: 1 = Authorize, 2 = Incremental |
| 5 | auth_code | String(50) | ✅ | Code from bank |
| 6 | description | String(255) | ❌ | Description |
| 7 | extend | Object | ❌ | Extended data |
Capture Information(3)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | capture_status | Number | ✅ | Capture status: 0 = Pending, 1 = Captured, 2 = Partial, 3 = Fail |
| 2 | bank_code | String(50) | ✅ | Bank code |
| 3 | capture_type | Number | ✅ | Capture type: 1 = Capture, 2 = Partial Capture |
| 4 | capture_amount | Number | ✅ | Amount |
| 5 | request_time | String(20) | ✅ | Time |
| 6 | extend | Object | ❌ | Extended data |
| 7 | description | String(255) | ❌ | Transaction description |
Refund Information(4)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | refund_status | Number | ✅ | Refund status: 0 = Pending, 1 = Refunded, 2 = Fail |
| 2 | refund_amount | Number | ✅ | Refund amount |
| 3 | request_time | String(20) | ✅ | Request time. Format: YYYY-MM-DD H:i:s |
| 4 | description | String(255) | ✅ | Description |
| 6 | extend | Object | ❌ | Extended data |
Reversal Information(5)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | refund_status | Number | ✅ | Refund status: 0 = Pending, 1 = Refunded, 2 = Fail |
| 2 | description | String(255) | ✅ | Description |
| 3 | request_time | String(20) | ✅ | Request time. Format: YYYY-MM-DD H:i:s |
| 4 | extend | Object | ❌ | Extended data |
Void Information(6)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | void_status | Number | ✅ | Void status: 0 = Pending, 1 = Reversed/Voided, 2 = Fail |
| 2 | description | String(255) | ✅ | Description |
| 3 | request_time | String(20) | ✅ | Request time. Format: YYYY-MM-DD H:i:s |
| 4 | extend | Object | ❌ | Extended data |
Example Response
{
"code": 0,
"message": "Success",
"data": {
"order_code": "VLAD_1753867524",
"amount": 1000000,
"status": 1,
"created_at": "2020-08-11 14:41:00",
"updated_at": "2020-08-11 15:41:00",
"steps": {
"authentication": {
"authen_status": 1,
"authen_amount": 1000000,
"request_time": "2020-08-11 14:41:00",
"url_success": "https://example.com/success",
"url_fail": "https://example.com/fail",
"off_3ds": 1,
"3ds_url": "https://payment-page.baokim.vn/payment/?oid=38260&checksum=d863a2d66f76e3fc7bcfe302bfc19ff3e5253f5c",
"extend": {}
},
"authorize": [
{
"authorize_status": 1,
"authorize_amount": 1000000,
"request_time": "2020-08-11 14:41:00",
"authorize_type": 1,
"auth_code": "AUTH456789",
"description": "",
"extend": {}
}
],
"capture": [
{
"capture_status": 1,
"capture_amount": 1000000,
"request_time": "2020-08-11 14:41:00",
"bank_code": "970436",
"capture_type": 1,
"description": "",
"extend": {}
}
],
"refund": [],
"reversal": [],
"void": []
}
}
}
Error Code Table
| Error Code | Description |
|---|---|
| 100 | Success |
| 11 | Failed |
| 101 | Baokim system error |
| 104 | OAuth authentication error |
| 105 | Signature authentication error |
| 422 | Validation error: RequestId invalid |
| 422 | Validation error: RequestTime invalid |
| 422 | Validation error: PartnerCode invalid |
| 422 | Card_data invalid |
| 422 | Amount invalid |
| 301 | Order not found by order_code |
| 302 | Card issue (does not exist, expired) |
| 303 | Card declined |
| 304 | Insufficient card balance |
| 305 | User cancelled transaction |
| 306 | Incorrect OTP |
| 308 | Transaction has not completed Authentication |
| 309 | Transaction has not completed Authorization |
| 310 | Transaction already reversed — cannot capture |
| 311 | Transaction already captured — cannot reverse |
| 313 | Bank-side processing error |