Get Cash Transactions
POST /openapi/v1/transaction/cash
Lấy danh sách giao dịch ghi nhận thanh toán bằng tiền mặt. Dùng cho nghiệp vụ chốt ca và báo cáo tổng hợp doanh thu.
Payload trước khi mã hóa:
{
"from_date": "2026-01-07 00:00:00",
"to_date": "2026-01-07 23:59:59",
"limit": 10,
"page": 1
}
| Field | Type | Required | Description |
|---|---|---|---|
from_date | string | ✅ | Thời gian bắt đầu (YYYY-MM-DD HH:MM:SS) |
to_date | string | ✅ | Thời gian kết thúc (YYYY-MM-DD HH:MM:SS) |
limit | number | ✅ | Số lượng bản ghi mỗi trang |
page | number | ✅ | Số trang (bắt đầu từ 1) |
- cURL
- Python
- Go
- JavaScript
curl --location '<base_url>/openapi/v1/transaction/cash' \
--header 'Partner-Code: YOUR_PARTNER_CODE' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsI…' \
--data '{
"data": ENCRYPTED_PAYLOAD
}'
import requests
url = "<base_url>/openapi/v1/transaction/cash"
payload = {"data": "ENCRYPTED_PAYLOAD"}
headers = {
"Partner-Code": "YOUR_PARTNER_CODE",
"Content-Type": "application/json",
"Authorization": "Bearer eyJhbGciOiJSUzI1NiIsI…",
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "<base_url>/openapi/v1/transaction/cash"
body := strings.NewReader(`{"data":"ENCRYPTED_PAYLOAD"}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Set("Partner-Code", "YOUR_PARTNER_CODE")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer eyJhbGciOiJSUzI1NiIsI…")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
result, _ := io.ReadAll(resp.Body)
fmt.Println(string(result))
}
const response = await fetch("<base_url>/openapi/v1/transaction/cash", {
method: "POST",
headers: {
"Partner-Code": "YOUR_PARTNER_CODE",
"Content-Type": "application/json",
"Authorization": "Bearer eyJhbGciOiJSUzI1NiIsI…",
},
body: JSON.stringify({ data: "ENCRYPTED_PAYLOAD" }),
});
const result = await response.text();
console.log(result);
Request
Headers
| Name | Required | Description |
|---|---|---|
Partner-Code | ✅ | Mã định danh Merchant (TCONNECT cung cấp) |
Content-Type | ✅ | application/json |
Authorization | ✅ | Bearer <access_token> |
Body
| Field | Type | Required | Description |
|---|---|---|---|
data | string | ✅ | Payload đã mã hóa AES-256-CBC dạng Hexadecimal |
Response
200 — Danh sách giao dịch tiền mặt
| Field | Type | Description |
|---|---|---|
data | array | Danh sách giao dịch |
data[].order_id | string | Mã hóa đơn |
data[].amount | number | Số tiền (VNĐ) |
data[].original_transaction_date | string | Ngày giờ ghi nhận giao dịch |
pagination.page | integer | Trang hiện tại |
pagination.limit | integer | Số bản ghi mỗi trang |
pagination.total_items | integer | Tổng số bản ghi |
pagination.total_pages | integer | Tổng số trang |