Get Customer Promotions

To get promotions of a customer
獲取顧客的優惠券

GET https://open.shopline.io/v1/customers/:customerID/promotions

Request Sample

curl --request GET \
     --url <<api_domain>>/v1/customers/id/promotions \
     --header 'Accept: application/json'

Path Param

Parameter

Column Type

Description

Example

Customer ID

String

Customer ID
顧客 ID

5f47c96a86a983001614a834

Query Param

Parameter

Column Type

Description

Example

coupon_status

string

status of Promotion
enum:

  • comingSoon(即將開始)
  • valid(可使用)
  • invalid(已失效)
    (Default: valid)

valid

available_platforms

string

Available Platforms
優惠券適用渠道

  • ec: 網店
    retail: 實體店

ec

coupon_type

array

Coupon Type
優惠券形式

  • draw: 領取型優惠券
    single: 單組通用代碼
    multi: 多組獨立代碼

draw

  • 若要一次輸入多組查詢參數:
    coupon_type[]=draw&coupon_type[]=single

usage

string

Usage
過濾優惠券已領用/不分領用狀況

  • coupon: 會員已領取的優惠券
    available: 會員已領取與在領券中心尚未領取的優惠券

coupon
預設是 coupon

Sample Response

{
    "items": [
        {
            "id": "62de11e0d3cb9338d5c5a950",
            "title_translations": {
                "en": "Promotions & Campaigns",
                "zh-hant": "-當指定商品--送贈品-update"
            },
            "discount_on": "item",
            "codes": [
                "hahahahaha1111"
            ],
            "user_max_use_count": 0,
            "max_use_count": 30,
            "use_count": 0,
            "user_use_count": 0,
            "first_purchase_only": false,
            "start_at": "2022-07-01T00:00:00.000+00:00",
            "end_at": "2022-08-01T00:00:00.000+00:00",
            "available_platforms": [
                "ec"
            ],
            "coupon_type": null
        }
    ]
}

Response Param

This API doesn't support pagination. It returns a maximum of 100 items.
此 API 不支援分頁,最多回傳 100 筆資料

Field

Type

Description

Example

items[].id

String

Promotion ID
優惠活動ID

5e8445bcca53240021eab706

items[].title_translations

Translation

Title translations
標題翻譯

Please check the link on the left

items[].discount_on

String

Promotion target
優惠套用對象

  • order = Entire shop 全店
    item = Specific item 指定商品
    category = Specific category 指定分類

order

items[].first_purchase_only

Boolean

For first purchase only
限首次購買使用

false

items[].codes

Array

Coupon Code
促銷代碼

  • ["VIP001",
    "VIP002"]_

items[].user_max_use_count

Integer

Limit per member
每會員最多使用次數

  • null = Unlimited 不限使用次數

1

items[].max_use_count

Integer

How many times can this promotion be used?
活動限使用次數

  • null = Unlimited 不限使用次數

10

items[].use_count

Integer

Usage of this layer of promotion
本階層活動已使用次數

5

items[].user_use_count

Integer

Customer Usage
該顧客使用次數

5

items[].start_at

DateTime

Promotion start time
活動開始時間

2020-07-09T04:00:00.000+00:00

items[].end_at

DateTime

Promotion end time
活動結束時間

  • null = no end date 永不過期

null

items[].available_platforms

Array

Available Platforms
優惠券適用渠道

  • ec: 網店
    retail: 實體店

[ec]

items[].coupon_type

String

Coupon Type
優惠券形式

  • draw: 領取型優惠券
    single: 單組通用代碼
    multi: 多組獨立代碼

draw

items[].drew_coupon_count

Integer

How many times did this promotion been drew?
活動被領取次數

items[].discount_type

String

discount type of the promotion
優惠券的折扣類型

items[].user_coupon_status

String

User Coupon Status, Only expose when coupon_type is draw
優惠卷領取狀態,只在領取型優惠卷顯示此欄位

-active, used ,inactive

active

items[].available_channels

Array

available channel
指定通路

items[].condition_scope

String

Promotion condition scope, Dependent on promotion's conditions
優惠套用條件

  • discounted_subtotal, discounted_products, discounted_categories, or empty

discounted_subtotal