商業系統
促銷與定價規則
Kanorio 在結帳時自動套用的折扣與優惠代碼。
促銷活動會改變顧客在結帳時的支付金額:包含滿足條件時自動套用的折扣,以及顧客輸入的優惠代碼。促銷活動指向其折扣的對象;商品本身並不擁有促銷活動。
API 的運作方式
- 使用 Management API 管理促銷活動:
promotions.list、promotions.get、promotions.create、promotions.update(PATCH)、promotions.archive、promotions.unarchive與promotions.delete。規則與後台相同,promotions.create支援Idempotency-Key。 - 以選擇器而非商品清單指定適用品項:
kinds(PRODUCT、BOOKING、CUSTOM)、refs(商品與可選的方案、預約資源,或自訂品項的 SKU)、categoryIds與priceRange。marketIds可將促銷限定在部分市場。預約與自訂品項也能納入範圍,包含滿額折抵。 - Kanorio 會在託管結帳過程中評估促銷活動,因此您的前端無需自行計算折扣。Headless 前端可讀取促銷活動來顯示標籤,但折扣只會在 Kanorio 的結帳頁套用。
- 訂閱
promotions.redeemed與promotions.redemption_revoked,即可得知已付款訂單使用了促銷、以及全額退款歸還了使用次數;ec.order.paid會帶promotionId與promotionCode。
下方的支援表格顯示了 API 所公開的功能。
API 開放的範圍
- Promotions & discount codes可用
- API
- Management API
promotions.*(list, get, create, update, archive, unarchive, delete; applied automatically at hosted checkout) - 託管網站
/marketing/promotions,/data/promotions- Webhooks
promotions.redeemed,promotions.redemption_revoked;ec.order.paidcarriespromotionId/promotionCode
API 參考
Webhook 事件
- promotions.redeemed · Fired when a paid order redeems a promotion (automatic discount or discount code). Carries the promotion, the order and how the discount was split across lines; never the buyer email.
- promotions.redemption_revoked · Fired when a full refund revokes a redemption (the promotion usage count is given back). Partial refunds do not revoke.
近期變更
- 2026-11-03 Promotions: create and manage promotions through the API; selector-based targeting
給網站擁有者
在後台如何使用這項產品,請見說明中心。
開啟說明中心