Get User Member Data
Description
取得會員資料中介 API。依商家之 siteinfo.member_source 自動分流查詢,統一格式化為標準會員資料結構(Ocard 格式)回傳:
- member_source = 2 (Ocard):轉發至 Ocard 會員資料查詢流程,回傳標準會員資料結構。
- member_source = 5 (Wixtar 會員):轉發至星益欣會員中心查詢會員資料 (GET /v1/member/wixtar/profile),並將會員資料格式化為標準結構(包含 member 與 point_card)回傳。
- 查無會員 (Wixtar):若 Wixtar 回傳查無會員(code = "404" 或 data = null),中介 API 統一轉為 HTTP 404 回傳。
- 目前限定僅支援 Ocard 與 Wixtar 會員。
Resource
GET /v1/user/member/data
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Query Parameters
| Name | Type | Description |
|---|---|---|
| shop_id | string | 門市編號 |
| mobile | string | 手機號碼 |
| field | string | 回傳欄位選擇,逗號分隔(僅 Wixtar 會員適用,未傳時預設全拿:vip,point,voucher,point_rules,external_data,buyer_number,id_citizen)(optional) |
Response Parameters
| Name | Type | Description |
|---|---|---|
| member | Member Object | 會員基本資料 |
| point_card | Point Card Object | 集點卡與點數資訊,若店家未啟用集點卡或無資料則為 null |
Response Parameters - Member Object
| Name | Type | Description |
|---|---|---|
| id | string | 會員編號 / 帳號 ID(Wixtar 對應 vip_id,Ocard 對應用戶 ID) |
| name | string | 會員姓名 |
| mobile | string | 會員註冊手機門號(格式如 0912345678) |
| head_image | string | 會員頭像網址,若無設定則為 null |
| group_id | string | 會員等級 / 群組代碼(Wixtar 依當前請求品牌 company_id 比對 brand_vip_groups 之 vip_group_id,Ocard 對應 pos_code),若無等級則為 null |
| group_name | string | 會員等級 / 群組名稱(Wixtar 依當前請求品牌 company_id 比對 brand_vip_groups 之 vip_group_name,Ocard 對應 vip.name),若無等級則為 null |
| carrier | string | 手機條碼載具(Wixtar 對應 buyer_number,Ocard 對應 carrier.code),若無綁定載具則為 null |
Response Parameters - Point Card Object
| Name | Type | Description |
|---|---|---|
| point | string | 目前會員可用累積點數 |
| spend | string | 消費累積點數金額(預設為 "0") |
| convert | string | 點數兌換比例(預設為 "1") |
| available_gift_count | string | 可用贈品券數量(預設為 "0") |
| title | string | 集點卡標題名稱(Wixtar 預設為 "會員點數") |
| content | string | 集點卡內容說明(Wixtar 預設為 "會員點數") |
| expire | Expire Object | 最近即將到期點數資訊,若無即將到期點數則為 null |
Response Parameters - Expire Object
| Name | Type | Description |
|---|---|---|
| date | string | 最近一筆點數到期日(格式如 2026-12-31 或 2026-12-31 23:59:59) |
| point | integer | 即將到期之點數額度 |
Request Example
GET /v1/user/member/data?shop_id=000030&mobile=0963023268
Response Example (Http Code = 200)
{
"member": {
"head_image": null,
"id": "U123456",
"name": "王大明",
"mobile": "0963023268",
"group_id": "VIP01",
"group_name": "金卡會員",
"carrier": "/ABC1234"
},
"point_card": {
"point": "14518",
"spend": "1579",
"convert": "100",
"available_gift_count": "10",
"title": "電子集點",
"content": "電子集點",
"expire": {
"date": "2026/12/31",
"point": 14488
}
}
}
Error Response Example - 查無會員 (Http Code = 404)
{
"message": "Wixtar查無對應會員"
}
Error Response Example - 不支援的會員來源 (Http Code = 400)
{
"code": "UWX0003",
"message": "目前會員資料查詢中介 API 僅支援 Ocard 或 Wixtar 會員"
}