/shops/{SHOP_ID}/transactionsDanh sách thu chiPOST/shops/{SHOP_ID}/transactionsTạo phiếu thu chiPOST/shops/{SHOP_ID}/adv_costsTạo chi phí quảng cáoPOST/shops/{SHOP_ID}/adv_costs/upsertTạo hoặc cập nhật chi phí quảng cáo theo tài khoản và ngàyGET/shops/{SHOP_ID}/payment_accounts/get_payment_historiesLịch sử giao dịchDanh sách thu chi
/shops/{SHOP_ID}/transactionsLấy danh sách thu chi
Tham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Tham số truy vấn
pageintegerSố trang
page_sizeintegerKích thước trang
statusintegerTrạng thái
-1Tất cả trạng thái0Mới1Có hiệu lực2Đã hủy3Đã xóastartDateTimeintegerThời điểm bắt đầu
endDateTimeintegerThời điểm kết thúc
Phản hồi
dataarray<Transaction>Danh sách thu chi
page_numberintegerSố trang
page_sizeintegerKích thước trang
successbooleanTrạng thái thành công
total_entriesintegerTổng số bản ghi
total_pagesintegerTổng số trang
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/transactions?api_key=API_KEY"{
"success": true,
"data": [
{
"id": "5b6bbae4-56b4-4189-a84d-d2ecfecead3e",
"display_id": "KH6815",
"name": "Giao dịch công nợ #1692 trả nhà cung cấp",
"note": "trả nhà cung cấp",
"amount": -70000,
"status": 1,
"is_locked": false,
"is_canceled": false,
"is_accounting": false,
"payment_debts_to_suppliers": false,
"payments": [
"cash"
],
"tag_ids": [
"193a-e877-359a-b340-01d8-4d2e-2050",
"55f6-111c-2fd5-38e8-5b9d-009f-d3b1"
],
"supplier_products_id": 293,
"advertising_cost_id": null,
"shop_id": 20,
"creator_id": "d6e6a545-f102-439e-9943-8ac8369f9735",
"creator": {
"id": "d6e6a545-f102-439e-9943-8ac8369f9735",
"name": "vudzung12",
"fb_id": "1286585024855632",
"avatar_url": null
},
"images": [
"https://content.pancake.vn/user-content-dev2.pancake.vn/2022/7/7/eb376f0bf90f47d25396d49e4d547700f182981b.jpg"
],
"inserted_at": "2023-09-23T05:00:20Z",
"time_incurred": "2023-09-23T05:00:20Z",
"table_name": "debts",
"orderId": null
}
]
}Tạo phiếu thu chi
/shops/{SHOP_ID}/transactionsTham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Nội dung yêu cầu
Thông tin yêu cầu chứa thông tin thu chi cần tạo
transactionobjectbắt buộcPhản hồi
successbooleanTrạng thái thành công
curl -X POST "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/transactions?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transaction": {
"name": "Thanh toán tiền hàng",
"note": "thanh toán tiền hàng",
"amount": -1000000,
"is_locked": false,
"tag_ids": [
"193a-e877-359a-b340-01d8-4d2e-2050"
],
"payments": [
"transfer_money"
],
"supplier_products_id": 293,
"is_accounting": true,
"time_incurred": "2023-09-23T08:41:54.404Z",
"payment_debts_to_suppliers": true,
"images": [
"https://content.pancake.vn/user-content-dev2.pancake.vn/2022/7/7/eb376f0bf90f47d25396d49e4d547700f182981b.jpg"
],
"orderId": "19785"
}
}'{
"success": true
}Tạo chi phí quảng cáo
/shops/{SHOP_ID}/adv_costsTham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Nội dung yêu cầu
Thông tin yêu cầu chứa thông tin chi phí quảng cáo cần tạo
paramsobjectbắt buộcPhản hồi
successbooleanTrạng thái thành công
curl -X POST "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/adv_costs?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{
"params": {
"cost_date": "2023-09-07 22:00:00",
"transaction": {
"name": "Chi phí quảng cáo",
"is_locked": false,
"note": "example",
"status": "0",
"time_incurred": "2023-09-07 15:00:00",
"tags": [
"Thẻ 1",
"Thẻ 2"
]
},
"items": [
{
"cost": 10000,
"tax": 5,
"warehouse_id": "IS",
"is_livestream": true,
"product": "1",
"pke_mkter": "test@gmail.com",
"source": {
"key": "-3",
"account": "3"
},
"is_wholesale": true,
"post_ids": [
"127967746288487_545680607828820"
]
}
]
}
}'{
"success": true
}Tạo hoặc cập nhật chi phí quảng cáo theo tài khoản và ngày
/shops/{SHOP_ID}/adv_costs/upsertMỗi phiếu ứng với một (ad_account_id, ngày của cost_date theo giờ shop). Chưa có thì tạo mới, có rồi thì cập nhật: dòng khớp theo (advertising_id, sản phẩm); dòng khớp chỉ ghi các field gửi lên, dòng mới được thêm, dòng không gửi giữ nguyên (gửi cost 0 để bỏ chi phí một dòng). Tổng phiếu và số tiền phiếu chi tính lại từ mọi dòng đang lưu theo Σ cost × (1 + tax/100). Khi cập nhật, transaction bị bỏ qua (tên, ghi chú, thẻ, trạng thái, thời điểm phát sinh giữ nguyên). Không ghi khi phiếu đã xoá, hoặc phiếu chi đã huỷ, xoá, khoá, chuyển công nợ nhà cung cấp. Cần quyền sửa phiếu thu chi. ad_account_id không được bắt đầu bằng act_ (dành cho phiếu tự tạo từ Quản lý quảng cáo Meta).
Tham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Nội dung yêu cầu
Chi phí quảng cáo của một tài khoản trong một ngày
paramsobjectbắt buộcPhản hồi
successbooleanTrạng thái thành công
curl -X POST "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/adv_costs/upsert?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{
"params": {
"ad_account_id": "123-456-7890",
"cost_date": "2026-05-10 00:00:00",
"transaction": {
"name": "Chi phí Google PMax 10/05",
"status": "1"
},
"items": [
{
"advertising_id": "21345678901",
"product": "SP001",
"cost": 150000,
"ads_source": "Google",
"advertising_account": "Webcake Ads",
"utm": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "pmax_tet"
}
},
{
"advertising_id": "21345678901",
"product": "SP002",
"cost": 0
}
]
}
}'{
"success": true
}Lịch sử giao dịch
/shops/{SHOP_ID}/payment_accounts/get_payment_historiesLấy lịch sử giao dịch thanh toán
Tham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Phản hồi
dataarray<object>Danh sách lịch sử thanh toán
successbooleanTrạng thái thành công
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/payment_accounts/get_payment_histories?api_key=API_KEY"{
"success": true,
"data": []
}