App Actions

Built-in outputs for driving conversions


Actions can be referenced by your Javascript to invoke an action in the mobile app. This is where you will pair any business logic in your block with a direct outcome in your usersโ€™ experience.

Using an App Action

Actions will work out of the box as long as you are building inside of the Custom Blocks editor (In the Javascript tab). No further setup is required beyond using the proper syntax, and calling the function with the required parameters.

Testing Actions

App Actions do not return success/error states to the block upon being called. However, you can manually test actions via the block preview in the Custom Blocks text editor. Actions will be printed to the browser console when successfully invoked.

Available App Actions


Use the addToCart to support interactions that add 1 or more products to the cart. This action accepts an array of lineItems, and additionally accepts custom line item attributes. Attributes are helpful for passing custom data back to Shopify, and any other downstream systems as a result of an order.

    lineItems: [
            variantId: 'String',
            quantity: Number,
            attributes: [ // optional
                    key: 'String',
                    value: 'String',


Navigating the user to checkout

Upon invoking the addToCart function, the app will reference this setting to determine if the user should be automatically navigated to the cart, or left where they are.


Use the openProduct to support interactions that take a user to a product detail page. This action accepts a productId, and an optional variantId if a specific variant needs to be pre-selecting upon opening the page. Setting isRelatedProduct to true will passively transition to new products from one PDP to another, setting it to false will reload a new page when transferring to a new PDP (Available only on PDPs).

    productId: 'String',
    variantId: 'String', // optional
    isRelatedProduct: Boolean // optional, works only on PDPs


Use the openCollection to support interactions that take a user to a product list page. This action accepts a collectionId.

    collectionId: 'String',


Use the showToast to display success or error messages to your end users. This will display natively & will be presented at the top of the page. This action accepts a a message, and a type to denote if it's a success or error message.

    message: 'String',
    type: 'String', // "success" || "error"
Example of a 'Success' toast

Example of a 'Success' toast

Example of an 'Error' toast

Example of an 'Error' toast