HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Get Member Point Rules

Function

To get member point rules with open API
獲取會員點數規則

URL

GET <<api_domain>>/v1/member_point_rules

Headers

FieldTypeDescriptionExample
AuthorizationStringBearer authentication with access token givenRequired: true

Request Parameters

per_pageIntegerNumbers of Categories per Page
每頁顯示 n 筆資料
(Default: 24)
ruby per_page=20
pageIntegerPage Number
頁數
(Default: 1)
ruby page=1

Response fields

FieldTypeDescriptionExample
itemsArrayThe result Array[
{
"id": "61af3c6be0adc70043875be9",
"status": "active",
"unit_price": 50,
"points_per_unit": 5,
"points_expire_day": 1,
"points_expire_month": 1,
"pending_days": 1,
"rule_type": "earn_from_order",
"remarks_translations": {
"en": "rules",
"zh-hant": "規則"
},
"membership_tier_id": null,
"unit_point": null,
"price_per_unit": null,
"point_value": -1,
"apply_threshold": null,
"available_platforms": [
"ec",
"retail"
]
}
]
paginationHashThe information of Pagination{
"current_page": 1,
"per_page": 10,
"total_count": 2,
"total_pages": 1
}

items entity

FieldTypeDescriptionExample
idStringMember point rule's ID61af3c6be0adc70043875be9
statusStringWhether the rules is applying
規則是否正在生效
Available types: ["active"]
active
rule_typeStringDefine the types of rules that the current object is representing.
定義這個物件正在表示的規則類別
Available types:
[earn_from_order,
max_percentage_per_order,
max_amount_per_order]
earn_from_order
unit_priceIntegerThe amount of purchase to earn a unit of points.
This field will be null if the rule_type is not "earn_from_order."
賺取一個單位的點數所需的購買金額
如rule_type不是"earn_from_order",此欄會是null
50
points_per_unitIntegerThe amount of points earned by a unit of unit_price.
This field will be null if the rule_type is not "earn_from_order".
一個單位的unit_price能夠賺取的點數
如rule_type不是"earn_from_order",此欄會是null
5
points_expire_dayIntegerThe expiry date of points, null if there is no expiry date.
This field will be null if the rule_type is not "earn_from_order".
點數的到期日,如規則並沒有設置點數會到期,此欄會是null
如rule_type不是"earn_from_order",此欄會是null
1
points_expire_monthIntegerThe expiry month of points, null if there is no expiry date.
This field will be null if the rule_type is not "earn_from_order".
點數的到期月份,如規則並沒有設置點數會到期,此欄會是null
如rule_type不是"earn_from_order",此欄會是null
1
pending_daysIntegerThe number of days after delivery received (Arrived/ Collected) will the system automatically assign the point to customer.
This field will be null if the rule_type is not "earn_from_order".
顧客訂單轉變為 已取貨 / 已到達(宅配) 後幾天自動發送點數
如rule_type不是"earn_from_order",此欄會是null
1
remarks_translationsHashRemarks of the rules in different language.
不同語言的點數規則說明
{ "en": "rules", "zh-hant": "規則" }
membership_tier_idStringThe id of membership_tier.5a7bf962e3880950d100026a
unit_pointIntegerThe amount of points needed to redeem a unit of discount.
This field will be null if the rule_type is "earn_from_order".
兌換一個單位的折扣所需的點數
如rule_type是"earn_from_order",此欄會是null
50
price_per_unitIntegerThe amount of discount per unit of points.
This field will be null if the rule_type is "earn_from_order".
一個單位的點數兌換到的折扣
如rule_type是"earn_from_order",此欄會是null
1
point_valueIntegerThe price to apply point discount.
It will be -1 if there is no constraint on applying discount.
This field will be -1 if the rule_type is "earn_from_order".
可以使用折扣的價錢
如沒有設置使用折扣的價格,此欄會是-1
如rule_type是"earn_from_order",此欄會是-1
20
apply_thresholdIntegerMaximum amount of point discount could be applied, the metric depends on the rule_type.
This field will be null if the rule_type is "earn_from_order".
可使用的最高折扣額,此欄的單位會因應rule_type而改變
如rule_type是"earn_from_order",此欄會是null
30
available_platformsArrayAvailable platforms.
'ec' means Online Store and 'retail' means Retail Store
此規則生效的平台,
'ec' 是指網店,'retail' 是指實體店
Available types:
["ec", "retail"]
[ "ec", "retail" ]

Remarks: The status of "earn_from_order" is always active. Whether the member points feature is activated will be determined by users.enable_member_point of the users setting. Please reference to the page Get Users Settings

pagination Entity

FieldTypeDescriptionExample
current_pageIntegerThe current page number1
per_pageIntegerThe number of items shown per page10
total_countIntegerThe number of elements in the items array2
total_pagesIntegerTotal number of pages1

Response Example

{
  "items": [
        {
            "id": "61af3c6be0adc70043875be9",
            "status": "active",
            "unit_price": 50,
            "points_per_unit": 5,
            "points_expire_day": 1,
            "points_expire_month": 1,
            "pending_days": 1,
            "rule_type": "earn_from_order",
            "remarks_translations": {
                "en": "rules",
                "zh-hant": "規則"
            },
            "membership_tier_id": null,
            "unit_point": null,
            "price_per_unit": null,
            "point_value": -1,
            "apply_threshold": null,
            "available_platforms": [
                "ec",
                "retail"
            ]
        },
        {
            "id": "61af3c6be0adc70046875bec",
            "status": "active",
            "unit_price": null,
            "points_per_unit": null,
            "points_expire_day": null,
            "points_expire_month": null,
            "pending_days": null,
            "rule_type": "max_percentage_per_order",
            "remarks_translations": {},
            "membership_tier_id": null,
            "unit_point": 50,
            "price_per_unit": 1,
            "point_value": 20,
            "apply_threshold": 30,
            "available_platforms": [
                "ec",
                "retail"
            ]
        }
    ],
    "pagination": {
        "current_page": 1,
        "per_page": 10,
        "total_count": 2,
        "total_pages": 1
    }
}