Public SDK
設定 Company ID 與 Token,即可在此頁面直接送出 API 請求。
EN
v6 Public SDK · Cloudflare 託管

FavCRM API 建立顧客端應用。

使用 public customer-portal API 建立預約、會員登入、CMS、活動、商店、優惠與問卷流程。每個章節都依開發者實際要建的工作流整理。

文件索引

代理或 LLM 應先讀取 /llms.txt。它會指向 canonical Markdown 指南與 OpenAPI 檔案,不需要抓取頁面內容。

快速開始

  1. 使用 X-Company-Id 或 storefront domain resolution 取得 tenant context。
  2. 店面內容、服務查詢與 checkout options 使用 public tenant endpoints。
  3. 顧客登入、註冊或 refresh 後,才使用 customer token 路由。
  4. 載入 OpenAPI 檔案取得精確 request body 與 response schema。
curl https://favcrm-connect-docs.stacksuite.workers.dev/llms.txt
curl https://favcrm-connect-docs.stacksuite.workers.dev/openapi/connect-v6.openapi.yaml

認證

Public SDK 端點使用 tenant context 與可選的 customer auth。Public tenant routes 使用 X-Company-Id 或已解析的 storefront context;customer routes 使用 Authorization: Bearer <customer-token>;magic-token routes 只用於邀請或簽署連結流程。

非 Public SDK 路由

Provider callbacks、MCP/OAuth discovery、system health、generated platform docs 與 internal developer routes 不會放入此 SDK 文件。

API 參考

Public v6 路由依店面或合作夥伴 app 需要建立的工作流分組。每個 operation 都包含認證 context、請求欄位、request payload、回應範例與 cURL。

6API 分組
51公開 operations
4認證

服務預約

探索服務、查詢時段、建立預約,並讓顧客管理預約紀錄。

  1. 取得用戶內容
  2. 列出服務
  3. 確認時段
  4. 建立訪客預約
  5. 讀取或更新顧客預約
GET /v6/customer-portal/services 公開用戶

列出服務

用戶的服務目錄。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
search string query
Filter services by name.
page integer query
Page number, starting at 1.
limit integer query
Page size, up to 100.
Try it
查詢參數
GET /v6/customer-portal/services/{id} 公開用戶

取得服務細節

服務細節、價格、時長與預約相關資訊。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
id string 必填 path
id path value.
Try it
路徑參數
GET /v6/customer-portal/services/{id}/staff 公開用戶

列出服務人員

可為此服務指派的人員。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
id string 必填 path
id path value.
Try it
路徑參數
GET /v6/customer-portal/services/{id}/resources 公開用戶

列出資源

房間、設備或其他可預約的資源。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
id string 必填 path
id path value.
Try it
路徑參數
GET /v6/customer-portal/services/{id}/slots 公開用戶

列出時段

指定日期與服務的可用時段。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
id string 必填 path
id path value.
date date 必填 query
Date to check, formatted as YYYY-MM-DD.
staffId string query
Limit availability to a specific staff member.
resourceId string query
Limit availability to a specific resource.
Try it
路徑參數
查詢參數
POST /v6/customer-portal/bookings/guest 公開用戶

建立訪客預約

不需登入即可建立預約。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
serviceId string 必填 body
Service to book.
occurrenceStart date-time 必填 body
Booking start time.
occurrenceEnd date-time 必填 body
Booking end time.
customerName string 必填 body
Guest customer name.
customerPhone string 必填 body
Guest customer phone.
customerEmail email body
Guest customer email.
staffId string body
Selected staff member.
resourceId string body
Selected resource.
Try it
請求 Body(JSON)
GET /v6/customer-portal/bookings 顧客憑證

列出顧客預約

已登入顧客的預約紀錄。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
Try it
GET /v6/customer-portal/bookings/{id} 顧客憑證

取得預約細節

已登入顧客的單筆預約細節。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
id string 必填 path
id path value.
Try it
路徑參數
POST /v6/customer-portal/bookings/{id}/cancel 顧客憑證

取消預約

取消顧客名下的預約。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
id string 必填 path
id path value.
reason string body
Customer-facing cancellation reason.
Try it
路徑參數
請求 Body(JSON)
POST /v6/customer-portal/bookings/{id}/reschedule 顧客憑證

更改預約

將顧客預約改至另一個時段。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
id string 必填 path
id path value.
occurrenceStart date-time 必填 body
New booking start time.
occurrenceEnd date-time 必填 body
New booking end time.
staffId string body
Updated staff member.
resourceId string body
Updated resource.
Try it
路徑參數
請求 Body(JSON)

會員登入

註冊顧客、以 OTP 登入、驗證憑證並維持顧客 Session。

  1. 取得登入管道
  2. 請求 OTP
  3. 驗證 OTP
  4. 使用 Bearer Token
  5. 更新或登出
GET /v6/customer-portal/auth/login-channel 公開用戶

取得登入管道

回傳用戶設定的登入方式。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it
POST /v6/customer-portal/auth/otp 公開用戶

請求 OTP

寄送 OTP 給顧客。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
phone string body
Customer phone for SMS or WhatsApp OTP.
email email body
Customer email for email OTP.
Try it
此端點未開放 Try it。

Try it 停用此端點,因為會實際發送 SMS / Email 或建立會員。請使用上方 cURL 在自有環境測試。

POST /v6/customer-portal/auth/otp/verify 公開用戶

驗證 OTP

以 OTP 換取顧客憑證。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
phone string body
Customer phone used for OTP.
email email body
Customer email used for OTP.
code string 必填 body
One-time password code.
Try it
此端點未開放 Try it。

Try it 停用此端點,因為會實際發送 SMS / Email 或建立會員。請使用上方 cURL 在自有環境測試。

POST /v6/customer-portal/auth/register 公開用戶

註冊會員

建立會員 / 顧客帳號。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
name string 必填 body
Customer first name or display name.
lastName string body
Customer last name.
phone string body
Customer phone.
email email body
Customer email.
source string body
Registration source, such as storefront or partner name.
Try it
此端點未開放 Try it。

Try it 停用此端點,因為會實際發送 SMS / Email 或建立會員。請使用上方 cURL 在自有環境測試。

POST /v6/customer-portal/auth/validate-token 顧客憑證

驗證憑證

檢查顧客憑證是否有效。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
Try it
POST /v6/customer-portal/auth/refresh 顧客憑證

更新憑證

更新現有的顧客 Session。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
Try it
POST /v6/customer-portal/auth/logout 顧客憑證

登出

結束顧客 Session。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
Try it
GET /v6/customer-portal/auth/registration-form 公開用戶

註冊表單

取得用戶自訂的註冊欄位。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it

CMS 與活動

呈現公開頁面內容、活動列表、報名、付款與入場驗證。

  1. 載入 CMS 導覽 / 內容
  2. 列出活動
  3. 報名出席者
  4. 建立付款意圖
  5. 驗證活動存取權
GET /v6/customer-portal/cms/pages 公開用戶

列出頁面

已發佈頁面。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it
GET /v6/customer-portal/cms/pages/{slug} 公開用戶

取得頁面

依 slug 取得已發佈頁面。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
slug string 必填 path
slug path value.
Try it
路徑參數
GET /v6/customer-portal/cms/posts 公開用戶

列出文章

已發佈的部落格 / CMS 文章。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
search string query
Text search.
page integer query
Page number, starting at 1.
limit integer query
Page size, up to 100.
Try it
查詢參數
GET /v6/customer-portal/cms/posts/{slug} 公開用戶

取得文章

依 slug 取得已發佈文章。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
slug string 必填 path
slug path value.
Try it
路徑參數
GET /v6/customer-portal/cms/categories 公開用戶

列出分類

公開的 CMS 分類。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it
GET /v6/customer-portal/cms/menus/{location} 公開用戶

取得選單

依位置取得導覽選單。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
location string 必填 path
location path value.
Try it
路徑參數
GET /v6/customer-portal/events 選用顧客憑證

列出活動

公開活動列表。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
search string query
Text search.
page integer query
Page number, starting at 1.
limit integer query
Page size, up to 100.
Try it
查詢參數
GET /v6/customer-portal/events/{slug} 選用顧客憑證

取得活動

公開活動細節。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
slug string 必填 path
slug path value.
Try it
路徑參數
POST /v6/customer-portal/event-registrations 選用顧客憑證

報名活動

建立活動出席者報名。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
eventId string 必填 body
Event id or slug being registered.
name string 必填 body
Attendee name.
email email body
Attendee email.
phone string body
Attendee phone.
quantity integer body
Number of seats or tickets.
Try it
請求 Body(JSON)
POST /v6/customer-portal/event-registrations/{id}/payment-intent 選用顧客憑證

建立活動付款意圖

開始活動報名的付款流程。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
id string 必填 path
id path value.
paymentMethodId string body
Selected payment method.
returnUrl url body
URL to return to after hosted payment.
Try it
路徑參數
請求 Body(JSON)
GET /v6/customer-portal/event-registrations/{id}/access 選用顧客憑證

驗證活動入場

檢查活動報名的入場權限。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
id string 必填 path
id path value.
Try it
路徑參數

商店與商務

建立公開店面,涵蓋商品、分類、結帳、付款狀態與顧客訂單。

  1. 列出商品
  2. 顯示商品細節
  3. 載入結帳選項
  4. 建立訂單
  5. 查詢付款狀態
GET /v6/customer-portal/shop/products 公開用戶

列出商品

公開商品目錄。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
search string query
Text search.
page integer query
Page number, starting at 1.
limit integer query
Page size, up to 100.
Try it
查詢參數
GET /v6/customer-portal/shop/products/{slug} 公開用戶

取得商品

依 slug 取得商品細節。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
slug string 必填 path
slug path value.
Try it
路徑參數
GET /v6/customer-portal/shop/categories 公開用戶

列出商店分類

商品分類。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it
GET /v6/customer-portal/shop/brands 公開用戶

列出品牌

商品品牌。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it
GET /v6/customer-portal/shop/collections 公開用戶

列出商品集合

商品集合 (collections)。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it
GET /v6/customer-portal/shop/shipping-methods 公開用戶

列出配送方式

可用的配送選項。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it
GET /v6/customer-portal/shop/payment-methods 公開用戶

列出付款方式

結帳可用的付款方式。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it
POST /v6/customer-portal/shop/orders 選用顧客憑證

建立訂單

建立店面訂單。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
items array 必填 body
Order lines with productId or variantId and quantity.
customer object body
Guest customer details when no customer token is used.
shippingMethodId string body
Selected shipping method.
paymentMethodId string body
Selected payment method.
Try it
請求 Body(JSON)
GET /v6/customer-portal/shop/orders 顧客憑證

列出顧客訂單

已登入顧客的訂單紀錄。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
Try it
GET /v6/customer-portal/shop/orders/{orderId}/payment-status 選用顧客憑證

訂單付款狀態

訂單的付款狀態。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
orderId string 必填 path
orderId path value.
Try it
路徑參數

會員權益與禮品

展示會員等級、公開優惠以及顧客的禮品兌換流程。

  1. 顯示會員等級
  2. 列出優惠
  3. 兌換或領取禮品
  4. 必要時完成兌換
GET /v6/customer-portal/membership-tiers 公開用戶

列出會員等級

用戶的公開會員等級。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Try it
GET /v6/customer-portal/gifts/offers 選用顧客憑證

列出禮品優惠

顧客可見的禮品優惠。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
Try it
GET /v6/customer-portal/gifts/offers/{id} 選用顧客憑證

取得禮品優惠

禮品優惠細節。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
id string 必填 path
id path value.
Try it
路徑參數
POST /v6/customer-portal/gifts/offers/{id}/redeem 顧客憑證

兌換禮品優惠

為顧客兌換優惠。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
id string 必填 path
id path value.
quantity integer body
Quantity to redeem. Defaults to 1.
Try it
路徑參數
請求 Body(JSON)
POST /v6/customer-portal/gifts/claim 選用顧客憑證

領取禮品

以領取資料或 Token 領取禮品。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
claimToken string body
Gift claim token from a link or campaign.
offerId string body
Offer to claim when using an authenticated customer flow.
Try it
請求 Body(JSON)
GET /v6/customer-portal/gifts/redemptions 顧客憑證

列出兌換紀錄

顧客的禮品兌換紀錄。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT 必填 header
Customer token from OTP, registration, or refresh.
Try it

表單與問卷

嵌入公開問卷,並支援以邀請憑證回覆的流程。

  1. 載入問卷
  2. 提交回覆
  3. 處理邀請連結
GET /v6/customer-portal/surveys/{slug} 選用顧客憑證

依 slug 取得問卷

公開問卷細節。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
slug string 必填 path
slug path value.
Try it
路徑參數
GET /v6/customer-portal/surveys/token/{token} 邀請連結憑證

依邀請 Token 取得問卷

邀請連結對應的問卷細節。

請求欄位
token string 必填 path
token path value.
Try it
此端點未開放 Try it。

邀請憑證端點對應特定邀請連結,請使用發給收件人的連結進行測試。

POST /v6/customer-portal/surveys/{id}/responses 選用顧客憑證

提交問卷回覆

提交公開問卷回覆。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
Authorization Bearer customer JWT header
Optional customer token for personalized availability, pricing, or ownership checks.
id string 必填 path
id path value.
answers object 必填 body
Map of survey question ids to answer values.
customerId string body
Known customer id when available.
metadata object body
Optional client metadata.
Try it
路徑參數
請求 Body(JSON)
POST /v6/customer-portal/surveys/token/{token}/responses 邀請連結憑證

提交邀請回覆

以邀請連結提交問卷回覆。

請求欄位
token string 必填 path
token path value.
answers object 必填 body
Map of survey question ids to answer values.
customerId string body
Known customer id when available.
metadata object body
Optional client metadata.
Try it
此端點未開放 Try it。

邀請憑證端點對應特定邀請連結,請使用發給收件人的連結進行測試。

GET /v6/customer-portal/storefront/resolve-domain 公開用戶

解析店面網域

依網域解析為用戶內容。

請求欄位
domain string 必填 query
Storefront host name to resolve.
Try it
查詢參數
POST /v6/customer-portal/contact 公開用戶

送出聯絡表單

建立公開聯絡查詢。

請求欄位
X-Company-Id string header
Tenant id. Can be omitted when tenant context is resolved from the storefront domain.
name string 必填 body
Contact name.
email email body
Contact email.
phone string body
Contact phone.
message string 必填 body
Inquiry message.
Try it
請求 Body(JSON)

舊版對照

舊版路由v6 對應路由回應格式變更
GET /connect/v1/pages/
GET /connect/v1/pages/{slug}/
GET /v6/customer-portal/cms/pages
GET /v6/customer-portal/cms/pages/{slug}
v6 使用 { success, data } envelope。列表資料位於 data.items,並可包含 pagination。
GET /connect/v1/blog/posts/
GET /connect/v1/blog/posts/{slug}/
GET /v6/customer-portal/cms/posts
GET /v6/customer-portal/cms/posts/{slug}
Blog 讀取移至 CMS posts。v6 會正規化欄位並回傳標準 success envelope。
GET /connect/v1/blog/categories/
GET /v6/customer-portal/cms/categories
分類列表會在標準 envelope 內回傳 v6 CMS category 物件。
POST /connect/v1/members/register/
POST /v6/customer-portal/auth/register
v6 會在 data.member 回傳已註冊會員/帳戶,並可能在 data.token 回傳 customer token。
POST /connect/v1/members/{member_uuid}/token/
POST /v6/customer-portal/auth/validate-token
POST /v6/customer-portal/auth/refresh
v6 用於驗證或 refresh customer token。只憑 member_uuid mint token 是舊版行為,需要 adapter。
GET /connect/v1/members/search/
沒有 public SDK 對應路由
建議建立 compatibility adapter
Public SDK 不提供廣泛會員搜尋。請使用 customer token 流程;若合作夥伴需要 legacy phone/member_uuid lookup,應建立窄版 adapter。
POST /connect/v1/members/reward-transactions/
沒有 public SDK 對應路由
建議建立 compatibility adapter
Reward balance mutation 不是 public SDK endpoint。若合作夥伴需要 legacy reward transaction contract,應使用 server-side adapter。
GET /connect/v1/events/
GET /connect/v1/events/{slug}/
GET /v6/customer-portal/events
GET /v6/customer-portal/events/{slug}
活動仍是公開讀取路由,但欄位會正規化到 data.items 或 data;日期與名額使用 v6 event 結構。
GET /connect/v1/booking-records/?member_uuid=...
GET /connect/v1/booking-records/{booking_uuid}/
GET /v6/customer-portal/bookings
GET /v6/customer-portal/bookings/{id}
v6 public 讀取以 customer token 限定範圍。完全相同的舊版 member_uuid 查詢語意需要 adapter。
LLM 使用方式

代理應先讀取 /llms.txt,再載入 /openapi/connect-v6.openapi.yaml 取得精確路徑覆蓋與 schemas。