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 |
| Bearer authentication with access token given | Required: true |
Request Parameters
per_page | Integer | Numbers of Categories per Page | ruby per_page=20 |
page | Integer | Page Number | ruby page=1 |
Response fields
Field | Type | Description | Example |
|---|---|---|---|
items |
| The result Array | [ |
pagination |
| The information of Pagination | { |
items entity
Field | Type | Description | Example |
|---|---|---|---|
id |
| Member point rule's ID | 61af3c6be0adc70043875be9 |
status |
| Whether the rules is applying | active |
rule_type |
| Define the types of rules that the current object is representing. | earn_from_order |
unit_price |
| The amount of purchase to earn a unit of points. | 50 |
points_per_unit |
| The amount of points earned by a unit of unit_price. | 5 |
points_expire_day |
| The expiry date of points, null if there is no expiry date. | 1 |
points_expire_month |
| The expiry month of points, null if there is no expiry date. | 1 |
pending_days |
| The number of days after delivery received (Arrived/ Collected) will the system automatically assign the point to customer. | 1 |
remarks_translations |
| Remarks of the rules in different language. | { "en": "rules", "zh-hant": "規則" } |
membership_tier_id |
| The id of membership_tier. | 5a7bf962e3880950d100026a |
unit_point |
| The amount of points needed to redeem a unit of discount. | 50 |
price_per_unit |
| The amount of discount per unit of points. | 1 |
point_value |
| The price to apply point discount. | 20 |
apply_threshold |
| Maximum amount of point discount could be applied, the metric depends on the rule_type. | 30 |
available_platforms |
| Available platforms. | [ "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 |
| The current page number | 1 |
per_page |
| The number of items shown per page | 10 |
total_count |
| The number of elements in the items array | 2 |
total_pages |
| 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 13 days ago