Query Transaction
Process
Description:
- Merchant calls the API to retrieve complete information and current status of an order.
- Response returns a
stepsstructure containing full history: authentication, authorize, capture, refund, reversal, void.
API Information
Method: GET
Request
(Parameters sent by merchant)
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | request_id | String(100) | ✅ | Unique request ID from Merchant to Baokim |
| 2 | request_time | String(20) | ✅ | Request send time. Format: YYYY-MM-DD H:i:s |
| 3 | merchant_code | String(50) | ✅ | Unique merchant identifier |
| 4 | order_code | String(50) | ✅ | Baokim order code returned from the Authentication step |
Example Request
{
"request_id": "MERCHANT050015588AXE014",
"request_time": "2020-08-11 14:41:00",
"merchant_code": "MERCHANT",
"order_code": "VLAD_1753867524"
}
Response
(Parameters returned by Baokim)
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | code | Number(3) | ✅ | Baokim error code |
| 2 | message | String(200) | ✅ | Error message |
| 3 | data | Object | ✅ | Data returned by Baokim |
Data Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | order_code | Number | ✅ | Baokim order code |
| 2 | amount | Number | ✅ | Order amount |
| 3 | status | Number | ✅ | Order status |
| 4 | created_at | Datetime | ✅ | Order creation time |
| 5 | updated_at | Datetime | ✅ | Order update time |
| 6 | steps | Object | ✅ | Processing steps information |
Steps Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | authentication | Object | ✅ | Authentication step information |
| 2 | authorize | Array | ✅ | Array of Authorization objects |
| 3 | capture | Array | ✅ | Array of Capture objects |
| 4 | refund | Array | ❌ | Array of Refund objects |
| 5 | reversal | Array | ❌ | Array of Reversal objects |
| 6 | void | Array | ❌ | Array of Void objects |
Steps.authentication Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | authen_status | Number | ✅ | Card authentication status: 0-Pending / 1-Authenticated / 2-Failed / 3-Bypass (3DS off) |
| 2 | authen_amount | Number | ✅ | Authentication amount |
| 3 | request_time | String(20) | ✅ | Request send time. Format: YYYY-MM-DD H:i:s |
| 4 | url_success | String(255) | ✅ | Redirect URL on successful authentication |
| 5 | url_fail | String(255) | ✅ | Redirect URL on failed authentication |
| 6 | off_3ds | Number | ❌ | 0-3DS not disabled / 1-3DS disabled |
| 7 | 3ds_url | String(255) | ✅ | 3DS authentication link |
| 8 | extend | Object | ❌ | Extended data |
Steps.authorize Array Object Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | authorize_status | Number | ✅ | Authorization status: 0-Pending / 1-Authorized / 2-Fail |
| 2 | authorize_amount | Number | ✅ | Authorization amount |
| 3 | request_time | String(20) | ✅ | Request send time |
| 4 | authorize_type | Number | ✅ | Authorization type: 1-Authorize / 2-Incremental Authorize |
| 5 | auth_code | String(50) | ✅ | Authorization code returned by bank |
| 6 | description | String(255) | ❌ | Authorization transaction description |
| 7 | extend | Object | ❌ | Extended data |
Steps.capture Array Object Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | capture_status | Number | ✅ | Capture status: 0-Pending / 1-Captured / 2-Partial Captured / 3-Fail |
| 2 | bank_code | String(50) | ✅ | Bank code |
| 3 | capture_type | Number | ✅ | Capture type: 1-Capture / 2-Partial Capture |
| 4 | capture_amount | Number | ✅ | Capture amount |
| 5 | request_time | String(20) | ✅ | Request send time |
| 6 | description | String(255) | ❌ | Capture transaction description |
| 7 | extend | Object | ❌ | Extended data |
Steps.refund Array Object Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | refund_status | Number | ✅ | Refund status: 0-Refund Pending / 1-Refunded / 2-Fail |
| 2 | refund_amount | Number | ✅ | Refund amount |
| 3 | request_time | String(20) | ✅ | Request send time. Format: YYYY-MM-DD H:i:s |
| 4 | description | String(255) | ✅ | Description |
| 5 | extend | Object | ❌ | Extended data |
Steps.reversal Array Object Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | reversal_status | Number | ✅ | Capture status: 0-Reversal Pending / 1-Reversed / 2-Fail |
| 2 | description | String(255) | ✅ | Description |
| 3 | request_time | String(20) | ✅ | Request send time. Format: YYYY-MM-DD H:i:s |
| 4 | extend | Object | ❌ | Extended data |
Steps.void Array Object Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | void_status | Number | ✅ | Void status: 0-Void Pending / 1-Voided / 2-Fail |
| 2 | description | String(255) | ✅ | Description |
| 3 | request_time | String(20) | ✅ | Request send time |
| 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
| Error Code | Description |
|---|---|
| 100 | Success |
| 11 | Failed |
| 101 | Baokim system error |
| 104 | OAuth authentication error |
| 105 | Signature authentication error |
| 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 |
| 422 | Validation error: RequestId invalid |
| 422 | Validation error: RequestTime invalid |
| 422 | Validation error: PartnerCode invalid |
| 422 | Card_data invalid |
| 422 | Amount invalid |