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 in the app.

  • Zapiet-managed integrations and notifications work automatically.

Considerations

  • Zapiet liquid variables will not work in Shopify notifications. Attributes won't exist at order creation, so templates must use the metafield variable, with the attribute variable as a fallback, 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, you can restore attributes to the order from the metafields.

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

  • If needed, you can keep specific attributes added during checkout.

    • Each additional attribute slows the checkout widget down and uses more of Shopify's checkout update limit.

  • External apps that read our attributes will need to either update their integration to read the metafield, or add a delay so they run after attributes are restored. Alternatively, you can keep the attributes they need during checkout.

    • Attributes will be deprecated in the future. We recommend external apps update to use metafields.

  • 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 customer's selections in the Shopify order view.
    ​

  • You will need to update any Shopify Flows to use the Get Zapiet Order Attributes action.


Attribute settings

After our support team has enabled metafields only mode, the Metafields and attributes settings appear in Settings > Developers. You can restore attributes, or keep specific attributes.

Restore attributes

Adds the full set of order attributes back to the order using the metafield. Use this if apps or reports read order attributes after the order is placed.

  1. Go to Settings > Developers.

  2. In Metafields and attributes, tick Restore attributes on orders.

  3. Click Save.

This runs after the order is created, so the attributes aren't available when the order is first placed. They are usually restored within a minute.

Keep specific attributes

Lets you choose specific attributes to keep adding during checkout. Use this if another checkout app or extension needs Zapiet values before the order is placed.

Each selected attribute adds extra updates to the cart during checkout. This slows the widget down slightly and uses more of Shopify's checkout update limit, which makes it more likely that order details are lost. Only select the attributes you need.

  1. Go to Settings > Developers.

  2. In Metafields and attributes, under Checkout attributes, expand Pickup, Delivery, Shipping or Custom attributes.

  3. Tick the attributes you need.

  4. Click Save.

Only the attributes for the customer's chosen method are added. If they switch method, the previous method's attributes are removed.

If both settings are on, the remaining attributes are added after the order is created. Attributes kept at checkout aren't duplicated.

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

Did this answer your question?