Block Client API

Block Callback Func

HandleUserAction1

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

  • instance string required

    Block instance identifier passed to the Blocks API.

    Empty string if an instance identifier has not been provided.

  • action UserAction1 required

    Which loyalty-page action the customer clicked.

  • params object required

    What the page already knew about the click.

    For redeem_points and redeem_points_towards_subscription, params contains pts, amount, and currency. amount is the usual amount string, or null when the selection has no money value. currency is still set.

    For redeem_vendible, vendible and venue are objects with bhid, plus slugs and api_name when those exist. Vendibles have no api_name. product and variant are objects with id (the external id) and title, and are omitted when that id is missing. pts is the point cost. A typed amount omits pts until the quote returns, and editing the amount clears it. denomination is the usual amount string, or null when the customer has not entered one. The call also includes title, redemption_method, and options when the card has them. The click does not spend points.

Previous
ClosePopup1