Metafields API Guides
GraphQL Storefront API: Cart Metafields
Working with cart metafields
Cart metafields let you add custom metadata to a cart to display product information. Cart metafields are key-value pairs. You can work with them using both the GraphQL Storefront API and the REST Management API.
Example queries and mutations
Query cart metafields
Request
Response
Example query: Get cart metafields
Create a cart metafield
The platform limits are as follows:
- 10 metafields per client (with customer ID or without ID) per cart
- 250 metafields in total for a single cart (e.g., 25 clients * 10 metafields)
Request
Response
Example mutation: Create a cart metafield
Update a cart metafield
Request
Response
Example mutation: Update a cart metafield
Delete a cart metafield
Request
Response
Example mutation: Delete a cart metafield