Query Transaction
Process
Merchant calls this API to retrieve a list of transactions for a VA.
API Information
Method: POST
URL: /b2b/core/api/ext/mm/bank-transfer/detail
Request
(Parameters sent by merchant)
Main Parameters
| 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 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 | acc_no | String | ✅ | VA account number to query |
| 6 | start_date | Datetime | ❌ | Query transactions from date. If null, Baokim defaults to T-1 |
| 7 | end_date | Datetime | ❌ | Query transactions to date |
Request Example
{
"request_id": "MERCHANT050015588AXE012",
"request_time": "2020-08-11 14:41:00",
"master_merchant_code": "MASTERMERCHANT",
"sub_merchant_code": "SUBMERCHANT",
"acc_no": "1234567890123",
"start_date": "2020-08-10 14:41:00",
"end_date": "2020-08-11 15:41:00"
}
Response
(Parameters returned by Baokim to merchant)
Main Parameters
| 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
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | va_info | Object | ✅ | VA information |
| 2 | transactions | Array | ✅ | Array of transaction list |
VA_info Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | bank_name | String | ✅ | VA bank name |
| 2 | bank_branch | String | ❌ | Branch |
| 3 | acc_no | String | ✅ | VA account number |
| 4 | acc_name | String | ✅ | VA account name |
| 5 | qr_string | Text | ✅ | QR code string |
| 6 | qr_path | String | ✅ | QR code image path |
Transactions Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | id | Integer | ✅ | Baokim transaction ID |
| 2 | order_id | Integer | ✅ | Baokim order ID |
| 3 | sub_merchant_fee | Integer | ✅ | Sub merchant fee |
| 4 | master_merchant_fee | Integer | ✅ | Master merchant fee |
| 5 | master_merchant_model | Integer | ✅ | Master merchant model |
| 6 | user_fee | Integer | ✅ | User fee |
| 7 | total_amount | Integer | ✅ | Total amount user needs to pay |
| 8 | amount | Integer | ✅ | Amount merchant receives |
| 9 | description | String | ✅ | Transaction content |
| 10 | status | Integer | ✅ | Transaction status |
| 11 | completed_at | Datetime | ✅ | Transaction completion time |
| 12 | created_at | Datetime | ✅ | Transaction creation time |
| 13 | updated_at | Datetime | ✅ | Transaction update time |
Example response:
{
"request_id": "MERCHANT050015588AXE012",
"request_time": "2020-08-11 14:41:00",
"master_merchant_code": "MASTERMERCHANT",
"sub_merchant_code": "SUBMERCHANT",
"store_code": null,
"branch_code": null,
"staff_code": null,
"va_info": {
"bank_name": "Ngân hàng TMCP Ngoại Thương Việt Nam (Vietcombank)",
"bank_branch": "Chi nhánh Hà Nội",
"acc_no": "01234567890123",
"acc_name": "BAOKIM NGUYEN VAN A",
"qr_string": "00020101021238550010A0000007270123000697040300000000000020386304C3A4",
"qr_path": "https://sandbox.baokim.vn/qr/BK1234567890.png"
},
"transaction": [
{
"id": 5567261,
"order_id": 1870436,
"sub_merchant_fee": 2200,
"master_merchant_fee": 1100,
"master_merchant_model": 1,
"user_fee": 0,
"total_amount": 200000,
"amount": 200000,
"description": "NGUYEN VAN A chuyen tien",
"status": 1,
"completed_at": "2020-08-11 14:41:00",
"created_at": "2020-08-11 14:41:00",
"updated_at": "2020-08-11 15:41:00"
}
]
}
Error Codes
| Error Code | Description |
|---|---|
| 100 | Success |
| 11 | Failed |
| 101 | Baokim system error |
| 103 | Signature authentication error |
| 104 | JWT authentication error |
| 422 | Invalid data |
| 710 | Sub merchant does not exist |
| 711 | Master merchant does not exist |
| 712 | Sub merchant is inactive |
| 713 | Master merchant is inactive |