Add a shipping address to the cart via cartBuyerIdentityUpdate (deliveryAddress field) or via cartDeliveryAddressesAdd if the multi-address delivery feature is available on your plan.
Query cart.deliveryGroups to retrieve grouped line items and their available deliveryOptions, each with a handle, title, estimatedCost, and deliveryMethodType.
Call cartSelectedDeliveryOptionsUpdate with the cart ID and an array mapping deliveryGroupId to the chosen deliveryOption handle.
Re-query cart.cost.totalAmount after selecting delivery options to include shipping cost in the total.
If deliveryGroups is empty or deliveryOptions is empty, the cart may lack a valid shipping address or the market may not support the requested shipping methods.
Consult current Shopify Storefront API changelog for which Storefront API version introduced multi-address delivery, as this feature requires a minimum API version.
Known gotchas
Delivery options are only populated after a valid shipping address is associated with the cart; without an address, deliveryGroups will return groups with empty deliveryOptions arrays.
Not all delivery method types are available in all markets or for all product types; digital products may appear in a separate group with no shipping options.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp