Store Credits

Bulk Update Store Credits

Changed on

Bulk update multiple user store credit records. <br> 批量更新多個 users 購物金

post/user_credits/bulk_update

Request

  • Base URL
    https://open.shopline.io/v1
  • URL
    https://open.shopline.io/v1/user_credits/bulk_update
  • Auth
    HTTP bearer

Request body

user_idsstring[] required

List of user IDs to update. <br> user ID 的列表,指定要更新的 user

valueinteger required

The value to set for each user's store credit. <br> 要給予每個 user 的購物金金額

remarksstring required

Remarks for the store credits update. <br> 購物金更新的備註

performer_idstring

The User ID of the performer making the update. Optional. <br> 執行者 User ID

expired_atstring date-time

Expiration date for the store credits. <br> 購物金的過期日期

email_target1 | 3

Allowed 1 & 3. 1 means not send, 3 means send all. <br> 電子郵件是否發送,1為不發送,3為發送

sms_notification_target1 | 2 | 3

Allowed 1~3. 1 means not send, 2 means send with verified, 3 means send all. <br> 簡訊是否發送通知,1為不發送,2為發送至驗證手機,3為全部發送

include_blacklistedboolean

Whether to include blacklisted (login/order-banned, status=blacklisted) customers as recipients. Default false. <br> 是否將黑名單(禁止登入下單,status=blacklisted)顧客納入發放對象,預設 false

Example request

{
  "user_ids": [
    "6512a1b2c3d4e5f601234567",
    "6512a1b2c3d4e5f601234568"
  ],
  "value": 100,
  "remarks": "Holiday bonus",
  "performer_id": "performer1",
  "expired_at": "2027-12-31T23:59:59Z",
  "email_target": 1,
  "sms_notification_target": 1
}

Response

Successfully updated the store credits. <br> 成功更新購物金記錄

resultboolean required

True when the batch was accepted and queued. This confirms acceptance only, not that every credit has been granted yet.

job_idstring required

ID of the queued batch job that grants the credit. Report it to the merchant so they can trace the batch in SHOPLINE Admin.

Example response

{
  "result": true,
  "job_id": "67596dd037cdd80016e58022"
}

Changes

    • breaking

      request body became required

    • breaking

      the request property's minItems was increased to 1

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the / request property's minLength was increased from 0 to 1

    • breaking

      the request property type changed from number to integer

    • warning

      the request property's maxLength was set to 50

    • warning

      the request property's max was set to 999999.00

    • warning

      the request property's min was set to 1.00

    • warning

      removed the optional property from the response with the status

    • info

      the request property default value 1 was added

    • info

      the request property default value false was added

    • info

      the request property default value 1 was added

    • info

      the response property became required for the status

    • info

      added the required property to the response with the status