HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Send Coupon

Function

To send coupon to user

發送領取型優惠券給指定顧客
(發送優惠券表示由系統直接代顧客領取該優惠券,會直接綁定該顧客帳戶並顯示於會員中心優惠券中)

URL

POST <<api_domain>>/v1/user_coupons

Request Parameters

ParameterTypeDescriptionExample
user_coupon.customer_id
*Required
StringCustomer ID
顧客 ID
ruby "customer_id":"58d3379401cda31bfb000000"
user_coupon.promotion_id
*Required
StringPromotion ID
優惠活動 ID
ruby "promotion_id":"58d3379401cda31bfb000000"
mail_notifyBooleanDo you want to notify the customer of the received coupon via email?
此優惠券發送後是否要以 email 通知顧客?

- *Default:false
ruby "mail_notify": false
sms_notifyBooleanDo you want to notify the customer of the received coupon via SMS?
此優惠券發送後是否要以簡訊通知顧客?

- *Default:false
ruby "sms_notify": true

Request Example

curl -X POST \
 <<api_domain>>/v1/user_coupons \
--header 'Authorization: Bearer access_token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "user_coupon":{
        "customer_id":"625d37140f2f2d5ad631a741",
        "promotion_id":"62f070e6b3f309003e6c2ef7"
    }
}'

Error Code List

Error CodeMeaning
NOT_ELIGIBLE優惠券不適用
ALREADY_TAKEN優惠券已被使用
EXPIRED優惠券已過期
FULLED優惠券已達使用次數
CREATED_FAILED優惠券創建失敗