VI | EN
Nhắn Messenger
Dành cho developer

List of debt — API Pancake POS

get /shops/{SHOP_ID}/debt · gọi qua Quantri360 bằng một API key cho chính tài khoản / tài sản bạn đã kết nối và ủy quyền — 360 lo việc ký request và làm mới phiên đăng nhập bạn đã cấp.

get /shops/{SHOP_ID}/debt

GET/shops/{SHOP_ID}/debtGọi qua 360: GET https://partner.quantri360.com/v1/pancake_pos/shops/{SHOP_ID}/debt
Sắp mở. API này đã chạy thật qua 360 và đang được chốt giá — bạn có thể đọc tài liệu và chuẩn bị tích hợp trước.
Mô tả API

Danh sách công nợ (phải thu khách / phải trả NCC): số tiền phải thu-trả, đã thu-trả, hạn, đơn hoặc phiếu nhập liên quan, khách. Dùng để theo dõi khách nợ COD / nợ đơn và nợ NCC.

  • Gọi thật: 1 khoản, các trường phân trang = null.
  • Khoản nợ tự sinh "tiền khách nợ đơn hàng" thực tế có type = 0 — đừng chỉ dựa vào type; xác định đối tượng bằng shop_customer_id (khách) hoặc supplier_products_id (NCC).
  • Có tên + SĐT khách trong shop_customer.

Request

Địa chỉ

GET https://partner.quantri360.com/v1/pancake_pos/shops/{SHOP_ID}/debt

Xác thực & gian hàng

TênVị tríKiểuMẫuMô tả
AuthorizationheaderheaderBearer q360_live_ab12cd34_…Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand.
platform_shop_idquerystring1234567SHOP_ID đã nối — có thể bỏ khi đường dẫn có /shops/{SHOP_ID}.

Tham số request

TênVị tríKiểuBắt buộcMẫuMô tả
SHOP_IDpathintegerCó1234567Mã cửa hàng đã nối với 360.
pagequeryintKhông1
page_sizequeryintKhông30
statusqueryintKhông-1-1 tất cả · 0 chưa giao dịch / thanh toán một phần · 1 đã giao dịch · 2 đã hủy.
shop_customer_idquerystringKhông96a8e283-…Lọc theo khách.

Ví dụ request

curl -s "https://partner.quantri360.com/v1/pancake_pos/shops/1234567/debt?page=1&page_size=30&status=-1" \
  -H "Authorization: Bearer $KEY"
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.get(
    "https://partner.quantri360.com/v1/pancake_pos/shops/1234567/debt",
    params={
        "page": 1,
        "page_size": 30,
        "status": -1
    },
    headers={"Authorization": f"Bearer {KEY}"},
    timeout=60,
)
print(r.status_code)
print(r.json())
Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/pancake_pos/shops/1234567/debt');
for (const [k, v] of Object.entries({"page":1,"page_size":30,"status":-1})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'GET',
  headers: { Authorization: `Bearer ${KEY}` },
});
console.log(r.status, await r.json());
PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/pancake_pos/shops/1234567/debt' . '?' . http_build_query(['page' => 1, 'page_size' => 30, 'status' => -1]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]);
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;

Response

Tham số phản hồi (nguyên của Pancake POS)

TênKiểuMẫuMô tả
successbooltrue
dataobject[]Khoản nợ.
idstringMã (UUID).
display_idint1Số hiển thị.
name_debtstringCông nợ tạo tự động
descriptionstringMô tả (vd "…tiền khách nợ đơn hàng #4117").
statusint0Như tham số status.
typeint0Loại công nợ (`0` phải trả / `1` phải thu — xem ghi chú).
money_must_pay_or_collectint0Tổng phải trả / phải thu (VND).
money_payed_or_collectedint0Đã trả / đã thu.
order_idintĐơn liên quan.
orderobjectid, display_id, cod, total_price, assigning_seller_id.
purchase_id / export_id / transaction_idstringPhiếu liên quan.
shop_customer_idstring
shop_customerobjectKhách: id, name, phone_numbers[], customer{fb_id, psid}.
supplier_products_idintNCC.
expired_atstringHạn thanh toán (UTC).
payment_datestring
inserted_at / updated_atstringUTC.
sum / page_number / page_size / total_pages / total_entriesnullGọi thật: đều null.

Mẫu phản hồi

{
  "success": true,
  "data": [
    {
      "id": "c0bee728-3b9d-4218-8517-b5a108b10000",
      "display_id": 1,
      "name_debt": "Công nợ tạo tự động",
      "description": "Công nợ được tạo tự động từ tiền khách nợ đơn hàng #4117",
      "status": 0,
      "type": 0,
      "money_must_pay_or_collect": 0,
      "money_payed_or_collected": 0,
      "order_id": 464290000,
      "order": {
        "id": 464290000,
        "display_id": 4117,
        "cod": 902300,
        "total_price": 902300
      },
      "shop_customer_id": "8815b3f4-…",
      "shop_customer": {
        "id": "8815b3f4-…",
        "name": "Khách hàng A",
        "phone_numbers": [
          "0901234567"
        ]
      },
      "expired_at": "2024-07-11T07:24:25",
      "inserted_at": "2024-06-11T07:24:25"
    }
  ],
  "sum": null,
  "page_size": null,
  "total_pages": null,
  "page_number": null,
  "total_entries": null
}

Bắt đầu dùng

  1. Đăng ký tài khoản Partner
  2. Mở loại dữ liệu thuộc nhóm Tài chính ở trang nền tảng
  3. Tạo API key (tick kênh Pancake POS)
  4. Gọi theo ví dụ ở trên