Update Customer Member Points
Function
Using open API to update customer member points
URL
POST API_DOMAIN/v1/customers/:id/member_points
若要使用此 API ,請確認店家是否已經開啟會員點數總開關以及設定點數規則Please make sure the "Member Points Toggle" has been set to "ON" and the point-earning rules has been set up before using this API.
Request Parameters
| Parameter | Column Type | Description | Example |
|---|---|---|---|
| id *Required | String | Customer ID 顧客ID | id=5e0047dfc4101900263b1450 |
| value *Required | Integer | Points to be added or deducted 增加或減除點數
| "value":100 |
| remarks *Required | String | Reason for adding or deducting member points 增加或減除點數原因
| |
| email_target | integer | Notification with Email 是否發送email通知 Only applicable for adding points 僅適用於增加 member points | 1=NOT_SEND全部不送 3=SEND_TO_ALL全部都送 |
| sms_notification_target | integer | Notification with SMS 是否發送簡訊通知 Only applicable for adding points 僅適用於增加 member points | 1=NOT_SEND全部不送 2=SEND_VERIFIED只送手機驗證過的 3=SEND_TO_ALL全部都送
|
| expire_date | date | Expiry date of points. 會員點數到期日 Only available when feature member_points_expiry_enhancement is enabled.
| 日期格式 (YYYY-MM-DD),如 2026-03-19 |
Response Fields
| Field | Column Type | Descritption | Example |
|---|---|---|---|
| customer_id | String | Customer ID 顧客ID | 5e0047dfc4101900263b1450 |
| point_balanc | Integer | Current Customer's Member Points 顧客現有會員點數 | 200 |
| remarks | String | Reason for adding or deducting credits 增加或減除點數原因 | add 100 member points |
| value | Integer | Points to be added or deducted 增加或減除點數 | 100 |
| end_at | Datetime | Expiry date, a null value means never expired 到期日期, null 表示不會到期
| 2021-09-14T16:00:00.000+00:00 |
Request Example
Create a Customer.
curl -X POST \
https://oapi.shoplinestg.com/v1/customers/:id/store_credits \
-H 'Accept: application/json' \
-H 'Authorization: Bearar access_token' \
-H 'Content-Type: application/json' \
-d '{
"id": "5e0047dfc4101900263b1450",
"value": 100,
"remarks": "add 100 member points",
}'Response Example
Also same with Get Order
{
"customer_id": "5e0047dfc4101900263b1450",
"point_balance": 200,
"remarks": "add 100 member points",
"value": 100,
"end_at": "2021-09-14T16:00:00.000+00:00"
}Error Message
| Content | Description |
|---|---|
| Response with this message in following situations: 1.value is not an integer 2.value is out of the valid range |
| Response with this message when value is 0 |
| Response with this message when value is not available
|
| If you send a remarks with more than 50 characters |
| If you send a remark with empty value |
| If you doesn't send remarks value or field
|
| If the token you use has no authority to add/deduct points. |
| If you don't have member points function |
| If you haven't setup the member points rules. |
Updated 3 months ago
Did this page help you?
