This guide shows you how to use a cart handler to update cart metafields. ## Requirements - You've completed the [quickstart guide](/docs/storefronts/headless/hydrogen/getting-started). - You've [set up a cart handler](/docs/storefronts/headless/hydrogen/cart/setup). ## Step 1: Read cart metafields Update the cart query fragment to return cart metafields. For more information, refer to the [default `CartApiQuery` fragment](https://github.com/Shopify/hydrogen/blob/main/packages/hydrogen/src/cart/queries/cartGetDefault.ts). The following example adds the`metafield` field:

## Step 2: Create a metafield form Use Remix's [`useFetcher`](https://remix.run/docs/en/main/hooks/use-fetcher) hook to create a form that submits information that you want to store in a metafield. The hook submits a form request to the `/cart` route's action when users submit with this metafield form. You can use this component anywhere in the app. When you use `fetcher.submit`, make sure there's a data key with the name `CartForm.INPUT_NAME`. The key value must be a JSON stringified object with `action` and `inputs` defined.

## Step 3: Handle the update metafield form request Handle the update metafield form request in an `action`. Use the `cart`, created from [`createCartHandler`](/docs/api/hydrogen/latest/utilities/createcarthandler), to handle cart mutation requests to the Storefront API.

## Next steps - Learn how to [update buyer identity](/docs/storefronts/headless/hydrogen/cart/buyer-identity).