取得 Token¶
POST /api/pos/v1/token
以 POS 帳號換取 access token。
Header
Content-Type: application/json
不需帶 Authorization。
Request
clientIdstring必填
POS 帳號,最多 50 字
範例:<your-client-id>
clientSecretstring必填
POS 密鑰
範例:<your-client-secret>
Response 200
accessTokenstring
後續請求放在 Authorization: Bearer {accessToken}
tokenTypestring
固定 Bearer
expiresInint
有效秒數,目前 43200(12 小時)
expiresAtstring
到期時間(UTC)
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"tokenType": "Bearer",
"expiresIn": 43200,
"expiresAt": "2026-10-30T02:00:00Z"
}
錯誤回應
// 400
{ "code": "VALIDATION_ERROR", "message": "缺少 clientId 或 clientSecret",
"details": [ { "field": "clientId", "reason": "必填" } ] }
// 401
{ "code": "INVALID_CLIENT", "message": "clientId 或 clientSecret 錯誤" }
// 403
{ "code": "CLIENT_DISABLED", "message": "POS 帳號已停用" }
// 429
{ "code": "RATE_LIMITED", "message": "請求過於頻繁,請稍後再試" }
狀態轉換限制:無。本 API 與訂位無關,不會改變任何訂位狀態。