HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

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

ParameterColumn TypeDescriptionExample
Customer IDStringCustomer ID
顧客 ID
5f47c96a86a983001614a834

Query Param

ParameterColumn TypeDescriptionExample
coupon_statusstringstatus of Promotion
enum:

- comingSoon(即將開始)
- valid(可使用)
- invalid(已失效)
(Default: valid)
valid
available_platformsstringAvailable Platforms
優惠券適用渠道

- ec: 網店
retail: 實體店
ec
coupon_typearrayCoupon Type
優惠券形式

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

*若要一次輸入多組查詢參數:
coupon_type[]=draw&coupon_type[]=single
usagestringUsage
過濾優惠券已領用/不分領用狀況

- 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 筆資料

FieldTypeDescriptionExample
items[].idStringPromotion ID
優惠活動ID
5e8445bcca53240021eab706
items[].title_translationsTranslationTitle translations
標題翻譯
Please check the link on the left
items[].discount_onStringPromotion target
優惠套用對象

- order = Entire shop 全店
item = Specific item 指定商品
category = Specific category 指定分類
order
items[].first_purchase_onlyBooleanFor first purchase only
限首次購買使用
false
items[].codesArrayCoupon Code
促銷代碼
["VIP001",
"VIP002"]
items[].user_max_use_countIntegerLimit per member
每會員最多使用次數

- null = Unlimited 不限使用次數
1
items[].max_use_countIntegerHow many times can this promotion be used?
活動限使用次數

- null = Unlimited 不限使用次數
10
items[].use_countIntegerUsage of this layer of promotion
本階層活動已使用次數
5
items[].user_use_countIntegerCustomer Usage
該顧客使用次數
5
items[].start_atDateTimePromotion start time
活動開始時間
2020-07-09T04:00:00.000+00:00
items[].end_atDateTimePromotion end time
活動結束時間

- null = no end date 永不過期
null
items[].available_platformsArrayAvailable Platforms
優惠券適用渠道

- ec: 網店
retail: 實體店
[ec]
items[].coupon_typeStringCoupon Type
優惠券形式

- draw: 領取型優惠券
single: 單組通用代碼
multi: 多組獨立代碼
draw
items[].drew_coupon_countIntegerHow many times did this promotion been drew?
活動被領取次數
items[].discount_typeStringdiscount type of the promotion
優惠券的折扣類型
items[].user_coupon_statusStringUser Coupon Status, Only expose when coupon_type is draw
優惠卷領取狀態,只在領取型優惠卷顯示此欄位

-active, used ,inactive
active
items[].available_channelsArrayavailable channel
指定通路
items[].condition_scopeStringPromotion condition scope, Dependent on promotion's conditions
優惠套用條件

- discounted_subtotal, discounted_products, discounted_categories, or empty
discounted_subtotal