Query Transactions
Process
Description:
Partners call this API to query detailed information about collection transactions. Results are paginated and can be filtered by multiple criteria (transaction ID, account, time, ...).
API Information
Method: POST
URL: {BASE_URL}/ats/transaction
Header: Signature — RSA-SHA1 signature of raw body (see Security).
Request
Main Parameters
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| request_id | String | ✅ | Request ID, unique. Maximum 50 characters, only letters, numbers, _, ., - |
| request_time | Datetime | ✅ | Request time. Format: YYYY-MM-DD HH:mm:ss. Must not differ by more than 10 minutes from Baokim time |
| partner_code | String | ✅ | Partner code provided by Baokim. Used for signature verification and result filtering |
| trans_id_bk | String | ❌ | Filter by Baokim transaction ID |
| trans_id_partner | String | ❌ | Filter by partner transaction ID |
| sub_merchant_code | String | ❌ | Filter by sub-merchant code |
| order_id | String | ❌ | Filter by order ID |
| acc_no | String | ❌ | Filter by virtual account number receiving funds |
| acc_name | String | ❌ | Filter by account name |
| store_code | String | ❌ | Filter by store code |
| payer_acc | String | ❌ | Filter by payer account number |
| from_date | Datetime | ❌ | Filter transactions from date (inclusive). Format: YYYY-MM-DD HH:mm:ss |
| end_date | Datetime | ❌ | Filter transactions to date (inclusive). Format: YYYY-MM-DD HH:mm:ss |
| page | Integer | ❌ | Page number (default: 1) |
| per_page | Integer | ❌ | Records per page (default: 15, maximum: 100) |
Request Example
{
"request_id": "ATS001KM2L9N",
"request_time": "2025-01-15 10:30:00",
"partner_code": "CASHPLUS",
"sub_merchant_code": "SHOP123",
"from_date": "2025-01-10 00:00:00",
"end_date": "2025-01-15 23:59:59",
"page": 1,
"per_page": 20
}
Response
note
HTTP 200 - Success
Main Parameters
| Field Name | Data Type | Description |
|---|---|---|
| response_code | Integer | Response code. 200 = success |
| response_message | String | Response message |
| response | Object | Paginated results. Not present on error |
Transaction Information (response.data[])
| Field Name | Data Type | Description |
|---|---|---|
| trans_id_bk | String | Baokim collection transaction ID (TransIdBk in collection webhook) |
| trans_id_partner | String | ReferenceId returned by CashPlus when collection webhook is received. null if webhook not received successfully |
| trans_time_partner | Datetime | Time when Baokim recorded CashPlus receiving the collection webhook |
| acc_no | String | Virtual account number receiving funds |
| acc_name | String | Virtual account name |
| trans_amount | Integer | Transaction amount (VND) |
| transfer_fee_amount | Integer | Collection fee (VND) |
| status | Integer | Collection transaction status. Always 1 = Success |
| memo | String | Transaction content/note |
| user_id | String | User ID with account synced matching payer account number. null if none |
| payer_name | String | Payer name. null if same as virtual account name |
| payer_acc | String | Payer account number |
| payer_bank | String | Payer bank name |
| payer_bank_no | String | Payer bank code |
| order_id | String | Order ID sent by CashPlus when creating virtual account |
| store_code | String | Store code |
| partner_code | String | Sub-merchant code |
| master_merchant_code | String | Partner code (same as partner_code in request) |
| announce_to_partner | Integer | 1 = CashPlus received collection webhook successfully |
| created_at | Datetime | Creation time |
| updated_at | Datetime | Last update time |
Pagination Information
Returned in response object:
{
"data": [...],
"current_page": 1,
"per_page": 15,
"total": 150,
"last_page": 10,
"from": 1,
"to": 15
}
Response Example
{
"response_code": 200,
"response_message": "Success",
"response": {
"data": [
{
"trans_id_bk": "TXN202501150001",
"trans_id_partner": "CASHPLUS_001",
"trans_time_partner": "2025-01-15 10:30:30",
"acc_no": "1234567890",
"acc_name": "Store A",
"trans_amount": 100000,
"transfer_fee_amount": 1500,
"status": 1,
"memo": "Payment for order",
"user_id": "CASHPLUS_USER123",
"payer_name": "Nguyen Van A",
"payer_acc": "9876543210",
"payer_bank": "Vietnam Prosperity Joint Stock Commercial Bank",
"payer_bank_no": "970416",
"order_id": "ORD202501150001",
"store_code": "STORE001",
"partner_code": "SHOP123",
"master_merchant_code": "CASHPLUS",
"announce_to_partner": 1,
"created_at": "2025-01-15 10:30:30",
"updated_at": "2025-01-15 10:31:00"
}
],
"current_page": 1,
"per_page": 20,
"total": 150,
"last_page": 8,
"from": 1,
"to": 20
}
}
Error Codes
| Error Code | Description |
|---|---|
| 200 | Success |
| 11 | Error during Baokim processing |
| 104 | request_id or request_time invalid (wrong format, duplicate request_id, or differs by more than 10 minutes) |
| 105 | partner_code invalid |
| 120 | Signature invalid |
| 201 | Invalid parameter (response_message indicates which field) |
Note
from_date,end_datefilter by transaction creation time (created_at).- Maximum 100 records per page.