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 | |
| value *Required | Integer | Credits to be added or deducted 增加或減除金額
| |
| remarks *Required | String | Reason for adding or deducting credits 增加或減除購物金原因
| |
| expires_at | Date | Validity Period 有效期限
null means Never expires | |
| email_target | Integer | Notification with Email 是否發送email通知
| |
| sms_notification_target | Integer | Notification with SMS 是否發送簡訊通知
| |
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 8 months ago
Did this page help you?
