Cart item custom fields returned in cart include responses
MINOR Cart item custom fields in include=items responses
Retrieving a single cart with include=items now returns each item's custom fields, the same data you get from Get Cart Items. Storefronts can read a cart and its fully described items in one request instead of two.
What's New?
- Consistent item data - Fields defined on the
cart_itemsflow now appear on every item underincluded.itemsinGET /v2/carts/:id?include=items, exactly as they do inGET /v2/carts/:id/items - Fewer requests - Storefronts that called Get Cart Items only to read item custom fields can drop that call
- No change without a flow - Stores that have not defined a
cart_itemsflow see no difference in the response
What's Changed?
- Cart event payloads -
cart.createdandcart.updatedevents delivered to webhooks and message queues are built from this same cart response, so the items in those payloads now carry the same custom fields. The change is additive; existing keys are unchanged - Payload size - Each field on the
cart_itemsflow adds one key to every included item,nullwhen unset. SQS queues cap messages at 256 KiB and elide included resources above that limit, so stores with a widecart_itemsflow and large carts may want to check their headroom
This applies to single-cart reads only. The cart list endpoint, orders, and quotes are unchanged.
For details see: