MetafieldsAPI
The API for interacting with metafields.
Anchor to standardapiStandardApi
The base API object provided to purchase
extension targets.
The metafields requested in the shopify.extension.toml
file. These metafields are updated when there's a change in the merchandise items being purchased by the customer.
App owned metafields are supported and are returned using the $app
format. The fully qualified reserved namespace format such as app--{your-app-id}[--{optional-namespace}]
is not supported. See app owned metafields for more information.
Requires access to protected customer data.
The metafields that apply to the current checkout.
Metafields are stored locally on the client and are applied to the order object after the checkout completes.
These metafields are shared by all extensions running on checkout, and persist for as long as the customer is working on this checkout.
Once the order is created, you can query these metafields using the GraphQL Admin API
> Cart metafields are only available on carts created via the Storefront API version 2023-04
or later.
Returns the metafields configured with shopify.extension.toml
.
Anchor to useAppMetafields-parametersParameters
Returns a single filtered Metafield
or undefined
.
Anchor to useMetafield-parametersParameters
Returns the current array of metafields
applied to the checkout. You can optionally filter the list.
Anchor to useMetafields-parametersParameters
Anchor to checkoutapiCheckoutApi
The API object provided to purchase.checkout
extension targets.
Performs an update on a piece of metadata attached to the checkout. If successful, this mutation results in an update to the value retrieved through the metafields
property.
This method will return an error if the cart instruction is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
Anchor to useApplyMetafieldsChangeuse Apply Metafields Change()
Returns a function to mutate the metafields
property of the checkout.