Skip to main content

Order metafields

The checkout widget now also adds order metafields to all orders

Written by Clemency Farmer

If you use the checkout widget, order metafields are added to the order by default.

The metafield is added as a JSON string, but you can make viewing the metafields easier by adding the order attributes block to your Shopify order view, and extracting the individual values in Shopify Flow.

By default, both order attributes and order metafields are now added by the checkout widget.

If you wish to remove order attributes (recommended), please contact our support team, and take a look at our metafields only section to review what this will impact and plan your migration.

In time, order attributes will be deprecated.


Requirements

  • You need to be using the checkout widget.
    Metafields are not added for the cart widget or checkout delivery options widget.


Add the order attributes block

To view the metafields in the Shopify order view, you can add the order attributes app block.

  1. Open the Shopify order dashboard, and open an order.

  2. In Blocks, click + Block.

  3. Click Zapiet order attributes.

  4. The block will be added. At the top-right of the block, click the pin icon to pin the block for all staff.

The order information will now be visible through the block.


Shopify Flow

Because all of your order data is stored together as JSON in a single metafield, Shopify Flow reads it as one long text value rather than as individual values.

To extract individual values like the checkout method, you can use a dedicated Shopify Flow action called Get Zapiet Order Attributes.

If the metafield is not present on an order, the action automatically falls back to the order's attributes. This means it keeps working for older orders and for orders placed through widgets that still use attributes.

To use it in a Flow:

  1. In your Shopify admin, open Shopify Flow, then create or edit a workflow.

  2. Choose a trigger for your workflow, for example Order created.

  3. Add an action and search for Get Zapiet Order Attributes.

  4. Add the action to your workflow. It will read the Zapiet metafield from the order in the trigger.

  5. The values returned by the action can then be used as normal Flow variables.


Metafields only mode

It is now possible to add only metafields to orders, preventing order attributes from being added.

Before switching to this mode, take a look at both the benefits and the considerations to ensure your store is ready.

Benefits

  • Faster checkout and fewer requests. Storing everything in one metafield means each change is a single write instead of updating or removing many separate attributes, which also uses far less of Shopify's cart update limit during checkout.

  • The metafield uses a namespace, so there are no naming conflicts with other apps.

  • Everything remains backward compatible: attributes and metafields both work.

  • Zapiet-managed integrations and notifications work automatically.

Considerations

  • Liquid variables will not work in Shopify notifications. Attributes won't exist at order creation, so templates must use the metafield variable and the attribute variable as a default e.g.:
    {{ metafields.zapiet.zapietAttributes.Checkout-Method | default: attributes.Checkout-Method }}.

    • You can convert the order attribute variables into order metafield variables by replacing attributes with metafields.zapiet.zapietAttributes. Take a look at our Liquid variable reference guide for more information.

  • If needed, we can restore attributes to the order from the metafields.

    • This action iruns after the order is placed, so attributes are not available immediately upon order creation.

    • To enable this feature, please contact our support team.

  • External apps that read our attributes will need either to update their integration to read the metafield, or to add a delay to run after the attributes are restored.

    • Attributes will be depreciated in the future. We recommend external apps update to use metafields, and add a delay until this functionality is added.

  • Shopify POS doesn't use metafields, so order attributes will continue to be added to POS orders.

  • You will need to add the order attributes block to view the customers selection's in the Shopify order view.

  • You will need to modify any Shopify Flows you have to first get the order attributes.

If you wish to switch to metafields only mode, please contact our support team.

Did this answer your question?