Wixtar Member Token
Description
Wixtar 全通路會員中介平台 - 取得 Access Token API。提供外部終端設備(POS/Kiosk)主動換發並維護 Wixtar 會員中心之 Access Token。全通路中介層將自動依全通路 Bearer Token 識別公司資訊,並由後台設定讀取對應之 authkey,搭配 Header 帶入之 X-Client-Id、X-Shop-Id 與 Request Body 帶入之 vendor_secret 向 Wixtar 會員平台發送 Token 換發請求 (POST /v1/public/token)。終端設備取得 Token 後,可於後續會員 API 呼叫時帶入 X-Member-Center-Token 自主管理 Token 生命週期。本 API 為純透傳無狀態設計,全通路後端不建立 Redis 快取。
Resource
POST /v1/member/wixtar/token
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
| Name |
Type |
Description |
| X-Client-Id |
string |
POS 機或呼叫端設備代碼 (必填) |
| X-Shop-Id |
string |
門市代碼 (必填) |
Request Body Parameters
| Name |
Type |
Description |
| vendor_secret |
string |
Wixtar 廠商密鑰 (必填,對應 Wixtar /v1/public/token 之 vendor_secret) |
Request Example
POST /v1/member/wixtar/token HTTP/1.1
Host: omni-dev.wixtar.com
Content-Type: application/json
Authorization: Bearer <YOUR_ACCESS_TOKEN>
X-Client-Id: POS01
X-Shop-Id: S001
{
"vendor_secret": "kC1jqJr2G6jjtymb9qpj06IUTcAN5uIK2sGBEYTLW3o"
}
Response Body Parameters
| Name |
Type |
Description |
| status |
integer |
HTTP 狀態碼 (例如: 200) |
| code |
string |
業務回應代碼 (成功為 "000000") |
| message |
string |
回應訊息 (例如: "Success") |
| data |
Data |
主要業務資料內容 |
Response Body Parameters - Data
| Name |
Type |
Description |
| access_token |
string |
JWT Bearer Token |
| token_type |
string |
Token 類型 |
| expires_in |
integer |
有效秒數 |
| expires_at |
string |
Token 到期時間(YYYY-MM-DD HH:MM:SS) |
| brand_ids |
list[string] |
授權品牌編號列表 |
Response Example - Http Code = 200
{
"status": 200,
"code": "000000",
"message": "Success",
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJicmFuZF9pZCI6IjI0NDM2MDc0IiwiYnJhbmRfaWRzIjpbIjI0NDM2MDc0IiwiMzY4ODEyMzQiXSwiY29uZ2xvbV9pZCI6IkMwMDEiLCJhdXRoa2V5IjoiQlJBTkRfQVVUSF9LRVlfQUJDMTIzIiwiY2xpZW50X2lkIjoiUE9TX1NZU1RFTV8wMSIsInRva2VuX3R5cGUiOiJicmFuZCIsImlhdCI6MTc0OTA1MjgwMCwiZXhwIjoxNzUxNjQ0ODAwfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"token_type": "Bearer",
"expires_in": 2592000,
"expires_at": "2025-07-05 00:00:00",
"brand_ids": [
"24436074",
"36881234"
]
}
}
Response Example 錯誤回應 - 400 Pydantic參數驗證(必填欄位缺漏)
{
"status": 200,
"code": "400",
"message": "缺少必填欄位:Wixtar 廠商密鑰(欄位代號:vendor_secret)",
"data": {
"errors_zh": [
"缺少必填欄位:Wixtar 廠商密鑰(欄位代號:vendor_secret)"
],
"errors": [
{
"type": "missing",
"loc": [
"body",
"vendor_secret"
],
"msg": "Field required",
"input": {}
}
]
}
}
Response Example 錯誤回應 - 400 缺少authkey
{
"status": 200,
"code": "400",
"message": "缺少 authkey 參數"
}
Response Example 錯誤回應 - 400 缺少shop_id
{
"status": 200,
"code": "400",
"message": "缺少 shop_id 參數"
}
Response Example 錯誤回應 - 400 缺少client_id
{
"status": 200,
"code": "400",
"message": "缺少 client_id 參數"
}
Response Example 錯誤回應 - 400 門市編號不存在或未啟用
{
"status": 200,
"code": "400",
"message": "門市編號不存在或未啟用"
}
Response Example 錯誤回應 - 401 不支援集團層authkey
{
"status": 401,
"code": "401",
"message": "v1 不支援集團層 authkey,請使用品牌層 authkey"
}
Response Example 錯誤回應 - 401 無效authkey
{
"status": 401,
"code": "401",
"message": "無效的 authkey,查無對應的集團或品牌"
}