Get Member Tickets
Description
會員可用票券清單查詢中介 API。依商家之 siteinfo.member_source 自動分流處理,統一格式化為標準可用票券結構(Ocard 格式)回傳:
- member_source = 2 (Ocard):轉發至 Ocard 票券查詢流程,回傳未核銷且未過期之 coupons 清單。
- member_source = 5 (Wixtar 會員):轉發至星益欣會員中心票券清單 API (GET /v1/public/members/vouchers?voucher_status=available),並將可用票券清單格式化為標準 coupons 結構回傳。
- 查無會員 (Wixtar):若 Wixtar 回傳查無會員(code = "404" 或 data = null),中介 API 統一轉為 HTTP 404 回傳。
- 目前限定僅支援 Ocard 與 Wixtar 會員。
Resource
GET /v1/ticket/member
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Query Parameters
| Name | Type | Description |
|---|---|---|
| mobile | string | 會員手機號碼(亦可傳 phone_number 或 vip_id) |
| shop_id | string | 門市代碼(亦可傳 store_id)(optional) |
| voucher_status | string | 票券狀態(Wixtar 預設為 available)(optional) |
Response Parameters
| Name | Type | Description |
|---|---|---|
| coupons | Coupon Object[] | 可用票券列表 |
Response Parameters - Coupon Object
| Name | Type | Description |
|---|---|---|
| id | string | 票券號碼 / 優惠券 ID(Wixtar 對應 tk_no,Ocard 對應券 ID) |
| title | string | 票券名稱 / 優惠券標題(Wixtar 對應 prod_name 或 description) |
| start_time | string | 票券有效起日(格式如 2026-01-01 00:00:00) |
| end_time | string | 票券有效迄日(格式如 2026-12-31 23:59:59) |
| image | string | 票券圖片網址,若無則為 null |
| pos_code | string | POS 促銷代碼/商品代碼(Wixtar 對應票券之 prod_id,Ocard 對應 pos_code,若無則為 null) |
| description | string | 票券描述資料(Wixtar 對應票券之 description;Ocard 則回傳 null) |
Request Example
GET /v1/ticket/member?mobile=0963023268 HTTP/1.1
Host: omni-dev.wixtar.com
Authorization: Bearer <YOUR_ACCESS_TOKEN>
Response Example (Http Code = 200)
{
"coupons": [
{
"id": "TK00000001",
"title": "春節折扣券商品",
"start_time": "2026-01-01 00:00:00",
"end_time": "2026-12-31 23:59:59",
"image": null,
"pos_code": "PROD0001",
"description": "春節限定折扣券"
}
]
}
Error Response Example - 查無會員 (Http Code = 404)
{
"message": "Wixtar查無對應會員 0963023268"
}
Error Response Example - 不支援的會員來源 (Http Code = 400)
{
"code": "TWX0003",
"message": "目前會員可用票券查詢中介 API 僅支援 Ocard 或 Wixtar 會員"
}