跳轉到

查詢對帳結果

GET /daily-close/{store_id}/{business_date}

查詢該門市該營業日的對帳結果。總部於收到日結約 15 分鐘後開始對帳,建議送出日結 30 分鐘後再查詢。

權限

API 金鑰(x-functions-key)

Request

Header 必填 說明
x-functions-key Y {api_key}

Path 參數

參數 型別 必填 說明
store_id string Y 門市代碼,須為總部登記給合作夥伴的門市
business_date date Y 營業日 YYYY-MM-DD
GET https://func-posingest-dev.azurewebsites.net/pos/v1/daily-close/US001/2026-10-14

Response

200 OK

欄位 型別 說明
store_id string 門市代碼
business_date date 營業日
status enum 對帳狀態,見下表
checked_at timestamp | null 對帳時間(UTC);尚未對帳為 null
expected object | null 日結送來的控制總數;NOT_RECEIVED 時為 null
actual object | null 總部依收到的交易計算的值;尚未對帳為 null
differences array of string 不一致的欄位名稱;一致時為 []

expected 與 actual 包含日結的控制總數欄位:trade_record_count、item_row_count、payment_row_count、net_sales_amount、tax_amount、tip_amount、payment_total_amount。

對帳狀態

status 意義 合作夥伴處理
NOT_RECEIVED 未收到日結 確認是否已送出
RECEIVED 已收到,尚未完成對帳 稍後再查
MATCHED 對帳一致 無
MISMATCHED 對帳不一致 補送缺漏交易(或以 version +1 更正),再重送日結

對帳規則

  • 筆數須完全相等。
  • 金額差須小於或等於該幣別最小單位(例 USD 0.01、JPY 1)。

範例

{
  "store_id": "US001",
  "business_date": "2026-10-14",
  "status": "MISMATCHED",
  "checked_at": "2026-10-15T09:30:00Z",
  "expected": { "trade_record_count": 312, "net_sales_amount": "9821.40" },
  "actual":   { "trade_record_count": 310, "net_sales_amount": "9790.10" },
  "differences": ["trade_record_count", "net_sales_amount"]
}

(範例僅節錄部分欄位。)

錯誤

HTTP code 情況
400 INVALID_PAYLOAD business_date 格式錯誤
401 UNAUTHORIZED 未帶 API 金鑰或金鑰錯誤
403 STORE_NOT_ALLOWED store_id 不屬於該合作夥伴

注意事項

MISMATCHED 時的處理

  1. 比對 differences 列出的欄位,找出缺漏或不一致的交易。
  2. 補送缺漏交易,或將異動交易 version +1 後重送(新的 batch_id)。
  3. 以新的 batch_id 重送日結。
  4. 約 30 分鐘後再次查詢。