資源與欄位
共用格式
| 項目 | 格式 |
|---|---|
| ID | 資源的 id 是 UUID 字串。每個物件帶 object 欄位標明資源類型 |
| 時間 | ISO 8601 UTC,例 2026-11-20T02:00:00Z |
| 金額 | 幣別主要單位的數值字串,不含千分位與符號,例 TWD "1200"、USD "12.50"。幣別在同一物件的 currency |
| 幣別 | 幣別代碼,例 TWD |
路徑中的 {id} 不是 UUID、不屬於這家店或已刪除時,回 404 resource_missing。
商家
GET /merchant 回傳金鑰所屬的商家。
| 欄位 | 型別 | 說明 |
|---|---|---|
id | string | 商家 ID |
object | string | 固定是 merchant |
name | string | 商家名稱 |
slug | string | 預約頁網址代稱 |
timezone | string | 商家時區(IANA 名稱) |
currency | string | 幣別代碼 |
locale | string | 預約頁的預設語系:zh_TW、en、ja |
服務
json
{
"id": "0198c5f4-0000-7000-8000-000000000001",
"object": "service",
"name": "體驗課",
"description": null,
"duration_minutes": 60,
"price": "1800",
"currency": "TWD",
"is_bookable": true,
"category": { "id": "0198c5f6-0000-7000-8000-000000000001", "name": "課程" },
"staff_ids": ["0198c5f5-0000-7000-8000-000000000001"],
"sort_order": 0
}| 欄位 | 型別 | 說明 |
|---|---|---|
id | string | 服務 ID |
object | string | 固定是 service |
name | string | 服務名稱 |
description | string 或 null | 服務說明 |
duration_minutes | number | 服務時長(分鐘) |
price | string | 價格,主要單位的數值字串 |
currency | string | 幣別代碼 |
is_bookable | boolean | 是否開放預約 |
category | object 或 null | 分類,含 id、name |
staff_ids | array | 提供這項服務的人員 ID,依 ID 遞增排列。每個 ID 都可用 GET /staff/{id} 查詢 |
sort_order | number | 排列順序 |
已刪除的服務不在列表中。
人員
json
{
"id": "0198c5f5-0000-7000-8000-000000000001",
"object": "staff",
"name": "範例老師"
}| 欄位 | 型別 | 說明 |
|---|---|---|
id | string | 人員 ID |
object | string | 固定是 staff |
name | string | 姓名 |
/staff 只列這家店的成員,已離開的人員不列出。
預約
json
{
"id": "0198c5f1-0000-7000-8000-000000000001",
"object": "appointment",
"reference": "7K3M9Q",
"series_id": null,
"status": "confirmed",
"source": "web",
"start_at": "2026-11-20T02:00:00Z",
"end_at": "2026-11-20T03:00:00Z",
"timezone": "Asia/Taipei",
"local_date": "2026-11-20",
"local_start_time": "10:00",
"local_end_time": "11:00",
"party_size": 1,
"total_price": "1800",
"currency": "TWD",
"payment_status": "unpaid",
"deposit": {
"amount": "500",
"paid": "0",
"due_at": "2026-11-18T15:59:59Z",
"reported_at": null
},
"status_reason": null,
"customer": {
"id": "0198c5f3-0000-7000-8000-000000000001",
"object": "customer",
"name": "範例顧客",
"phone": "+886900000000",
"email": "customer@example.com"
},
"items": [
{
"service": { "id": "0198c5f4-0000-7000-8000-000000000001", "name": "體驗課" },
"staff": { "id": "0198c5f5-0000-7000-8000-000000000001", "name": "範例老師" },
"start_at": "2026-11-20T02:00:00Z",
"end_at": "2026-11-20T03:00:00Z",
"duration_minutes": 60,
"quantity": 1,
"unit_price": "1800",
"pricing_basis": "per_booking",
"line_total": "1800"
}
],
"created_at": "2026-11-15T06:29:40Z",
"updated_at": "2026-11-15T06:29:40Z"
}| 欄位 | 型別 | 說明 |
|---|---|---|
id | string | 預約 ID |
object | string | 固定是 appointment |
reference | string 或 null | 預約編號 |
series_id | string 或 null | 系列 ID |
status | string | pending、confirmed、completed、cancelled、no_show |
source | string 或 null | 預約來源:web、line_liff、line_conversation、merchant_panel |
start_at | string | 開始時間,ISO 8601 UTC |
end_at | string | 服務結束時間,ISO 8601 UTC |
timezone | string | 商家時區(IANA 名稱) |
local_date | string | 商家時區的日期,YYYY-MM-DD |
local_start_time | string | 商家時區的開始時間,HH:mm |
local_end_time | string | 商家時區的結束時間,HH:mm |
party_size | number | 人數 |
total_price | string | 總金額,主要單位的數值字串 |
currency | string | 幣別代碼 |
payment_status | string | unpaid、partially_paid、fully_paid |
deposit | object 或 null | 訂金,沒有訂金時是 null,欄位見訂金 |
status_reason | string 或 null | 取消或爽約時填寫的原因,其他情況與沒填寫時是 null |
customer | object 或 null | 顧客,沒有顧客時是 null,欄位見預約裡的顧客 |
items | array | 預約品項,欄位見品項 |
created_at | string 或 null | 預約建立時間,ISO 8601 UTC |
updated_at | string 或 null | 預約最後更新時間,ISO 8601 UTC |
已刪除的預約不在列表中。
訂金
| 欄位 | 型別 | 說明 |
|---|---|---|
amount | string | 訂金金額,主要單位的數值字串 |
paid | string | 已付訂金,主要單位的數值字串 |
due_at | string 或 null | 訂金期限,ISO 8601 UTC |
reported_at | string 或 null | 顧客回報已付款的時間,ISO 8601 UTC |
預約裡的顧客
金鑰有 customers:read 時:
| 欄位 | 型別 | 說明 |
|---|---|---|
id | string | 顧客 ID |
object | string | 固定是 customer |
name | string 或 null | 姓名 |
phone | string 或 null | 電話 |
email | string 或 null |
金鑰沒有 customers:read 時只有 id 與 object:
json
{ "id": "0198c5f3-0000-7000-8000-000000000001", "object": "customer" }品項
| 欄位 | 型別 | 說明 |
|---|---|---|
service.id | string | 服務 ID |
service.name | string 或 null | 服務名稱 |
staff | object 或 null | 人員。沒有指定人員時是 null;有值時含 id、name(name 可為 null) |
start_at | string 或 null | 品項開始時間,ISO 8601 UTC |
end_at | string 或 null | 品項的服務結束時間,ISO 8601 UTC |
duration_minutes | number | 服務時長(分鐘) |
quantity | number | 人數 |
unit_price | string | 單價,主要單位的數值字串 |
pricing_basis | string | per_booking(整組定價)或 per_person(依人數計價) |
line_total | string | 這個品項的金額,主要單位的數值字串 |
品項的 staff.id 是已不在這家店的人員時,GET /staff/{id} 回 404。
顧客
json
{
"id": "0198c5f3-0000-7000-8000-000000000001",
"object": "customer",
"name": "範例顧客",
"email": "customer@example.com",
"phone": "+886900000000",
"preferred_locale": "zh_TW",
"created_at": "2026-11-01T08:00:00Z",
"updated_at": "2026-11-15T06:29:40Z"
}| 欄位 | 型別 | 說明 |
|---|---|---|
id | string | 顧客 ID |
object | string | 固定是 customer |
name | string 或 null | 姓名 |
email | string 或 null | |
phone | string 或 null | 電話 |
preferred_locale | string 或 null | 偏好語系:zh_TW、en、ja |
created_at | string 或 null | 建立時間,ISO 8601 UTC |
updated_at | string 或 null | 最後更新時間,ISO 8601 UTC |
封存的顧客不在列表中,GET /customers/{id} 回 404。
收款
json
{
"id": "0198c5f4-0000-7000-8000-000000000001",
"object": "payment",
"appointment_id": "0198c5f1-0000-7000-8000-000000000001",
"amount": "500",
"currency": "TWD",
"method": "cash",
"created_at": "2026-11-20T03:05:00Z"
}| 欄位 | 型別 | 說明 |
|---|---|---|
id | string | 收款 ID |
object | string | 固定是 payment |
appointment_id | string | 這筆收款所屬的預約 ID |
amount | string | 金額,主要單位的數值字串,不帶正負號 |
currency | string | 幣別代碼 |
method | string | cash、points(點數)、bank_transfer、line_pay、newebpay(藍新金流)、payuni(統一金流)、stripe、other |
created_at | string | 記下這筆收款的時間,ISO 8601 UTC |
- 已刪除預約的收款不在列表中,
GET /payments/{id}回 404。 GET /payments/{id}帶退款的 ID 時回 404。
退款
欄位與收款相同,object 固定是 refund,amount 同樣不帶正負號。
- 已刪除預約的退款不在列表中,
GET /refunds/{id}回 404。 GET /refunds/{id}帶收款的 ID 時回 404。