Get Member Point Rules
Function
To get member point rules with open API
獲取會員點數規則
URL
GET <<api_domain>>/v1/member_point_rules
Headers
Field | Type | Description | Example |
---|---|---|---|
Authorization | String | Bearer authentication with access token given | Required: true |
Request Parameters
per_page | Integer | Numbers of Categories per Page 每頁顯示 n 筆資料 (Default: 24) | ruby per_page=20 |
page | Integer | Page Number 頁數 (Default: 1) | ruby page=1 |
Response fields
Field | Type | Description | Example |
---|---|---|---|
items | Array | The 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" ] } ] |
pagination | Hash | The information of Pagination | { "current_page": 1, "per_page": 10, "total_count": 2, "total_pages": 1 } |
items entity
Field | Type | Description | Example |
---|---|---|---|
id | String | Member point rule's ID | 61af3c6be0adc70043875be9 |
status | String | Whether the rules is applying 規則是否正在生效 Available types: ["active"] | active |
rule_type | String | Define 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_price | Integer | The 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_unit | Integer | The 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_day | Integer | The 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_month | Integer | The 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_days | Integer | The 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_translations | Hash | Remarks of the rules in different language. 不同語言的點數規則說明 | { "en": "rules", "zh-hant": "規則" } |
membership_tier_id | String | The id of membership_tier. | 5a7bf962e3880950d100026a |
unit_point | Integer | The 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_unit | Integer | The 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_value | Integer | The 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_threshold | Integer | Maximum 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_platforms | Array | Available 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
Field | Type | Description | Example |
---|---|---|---|
current_page | Integer | The current page number | 1 |
per_page | Integer | The number of items shown per page | 10 |
total_count | Integer | The number of elements in the items array | 2 |
total_pages | Integer | Total number of pages | 1 |
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
}
}
Updated almost 3 years ago