Hooks API
Web HookApplyCartChange1
Apply loyalty cart changes on the storefront cart.
| Kind | Mutation Hook |
|---|---|
| Method | POST |
| URL | The webhook URL you specify, with :name replaced by ApplyCartChange1 |
| Authentication | JWT HS256 Bearer token |
Subscribe to this hook from Hello1 when Bubblehouse's first-party widget should apply rewards to carts in your storefront.
The widget passes a cart ID from the storefront (an IFRAME URL parameter or a JavaScript call). Bubblehouse then calls this hook with a CartChanges2 payload: coupons to add, coupon codes to remove, and reserved line-item slots.
Apply the subset of effects your program uses. Ignore unknown future change kinds.
Return {"ok": true} after the changes have been applied, or when they were already in place.
Bubblehouse calls this hook in real time and waits for the result.
Input
-
cart_idstring requiredCart identifier from the storefront.
-
Effects to apply to that cart.
Output
A successful response has no meaningful properties and only contains an ok property always set to true:
{"ok": true}