Block Client API
Block Callback FuncHandleUserAction1
A loyalty-page button was clicked and the storefront should handle it.
| Kind | Block Callback |
|---|---|
| Default transport | postMessage |
| Message Data | { "bubblehouseBlockClientCall": "HandleUserAction1", ... } |
Bubblehouse does not perform the action and does not spend points. If the storefront does nothing, the click is cancelled.
The included script does not perform this call. It re-raises it as a bubbling DOM event named bhclient:HandleUserAction1 on the block instance element. Listen for that event, or for postMessage where bubblehouseBlockClientCall is HandleUserAction1.
Only shops that turn on a storefront override send this call. The action value says which button was clicked.
Input
-
instancestring requiredBlock instance identifier passed to the Blocks API.
Empty string if an instance identifier has not been provided.
-
Which loyalty-page action the customer clicked.
-
paramsobject requiredWhat the page already knew about the click.
For
redeem_pointsandredeem_points_towards_subscription,paramscontainspts,amount, andcurrency.amountis the usual amount string, ornullwhen the selection has no money value.currencyis still set.For
redeem_vendible,vendibleandvenueare objects withbhid, plusslugsandapi_namewhen those exist. Vendibles have noapi_name.productandvariantare objects withid(the external id) andtitle, and are omitted when that id is missing.ptsis the point cost. A typed amount omitsptsuntil the quote returns, and editing the amount clears it.denominationis the usual amount string, ornullwhen the customer has not entered one. The call also includestitle,redemption_method, andoptionswhen the card has them. The click does not spend points.