update_customer_store_credits
Adjust a customer's store credit balance by adding or deducting credits for top-ups, refunds, or promotional rewards. Updates balance immediately and logs the change in the customer's credit history.
Instructions
[WRITE] 調整客戶儲值金餘額。
【用途】 增加或扣除客戶儲值金,常用於儲值金充值、退款補償、活動贈送等場景。
【呼叫的 Shopline API】
PUT /v1/customers/{customer_id}/store-credits
【回傳結構】 dict 含 success: bool, resource_id: str, message: str。
【副作用】
客戶儲值金餘額立即變動
異動紀錄會寫入客戶的儲值金歷史(可透過 get_customer_profile 查看)
扣除後如餘額不足,API 可能回傳錯誤
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customer_id | Yes | 客戶內部 ID | |
| amount | Yes | 調整金額(正數=增加,負數=扣除) | |
| note | No | 調整備註/原因 |