Update Customer Store Credits
Function
To update customer store credits with open API
使用 open API 更新顧客購物金
URL
POST <<api_domain>>/v1/customers/:id/store_credits
Request Parameters
Parameter | Value | Description | Example |
---|---|---|---|
id *Required | String | Customer ID 顧客ID | ruby id=58d3440869702d39b7060000 |
value *Required | Integer | Credits to be added or deducted 增加或減除金額 - *Number can be -999999~999999 | ruby "value":100 |
remarks *Required | String | Reason for adding or deducting credits 增加或減除購物金原因 - * Limit to max 50 characters | ruby "remarks":"add 100 store credits" "remarks":"週年慶贈送 100紅利" |
expires_at | Date | Validity Period 有效期限 - Date cannot be in the past. Date should be within 9999 days from now. null means Never expires | ruby "expires_at": "2021-11-30" |
email_target | Integer | Notification with Email 是否發送email通知 - 1=NOT_SEND全部不送 3=SEND_TO_ALL全部都送 | ruby "email_target":1 |
sms_notification_target | Integer | Notification with SMS 是否發送簡訊通知 - 1=NOT_SEND全部不送 2=SEND_VERIFIED只送手機驗證過的 * 3=SEND_TO_ALL全部都送 | ruby "sms_notification_target":1 |
Response fields
Field | Column Type | Descritption | Example |
---|---|---|---|
customer_id | String | Customer unique ID. 顧客ID | 58d3440869702d39b7060000 |
credit_balance | Integer | Current Customer Credit 顧客現有購物金 | 500 |
remarks | String | Reason for adding or deducting credits 增加或減除購物金原因 | add 100 store credits |
value | Integer | Credits to be added or deducted 增加或減除金額 | 100 |
end_at | Datetime | Validity Period 有效期限 | 2021-11-30T00: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 '{
"value": 100,
"remarks": "add 100 store credits",
"expires_at": "2021-11-30"
}'
Response Example
{
"customer_id": "58d3440869702d39b7060000",
"credit_balance": 500,
"remarks": "add 100 store credits",
"value": 100,
"end_at": "2021-11-30T00:00:00.000+00:00"
}
Updated 11 months ago