Overview
Henry’s Universal Cart endpoints lets you manage a universal shopping cart for your users. All you need to provide is a product link and variant information for items to be added to cart. It’s up to you whether you want to use your own product catalog or rely on Henry’s Product Discovery APIs to fetch product details.Required headers
x-api-key: Your Henry Shopping API key (sandbox or production)x-user-id: Stable identifier for the shopper. Use the same value everywhere you read or mutate the cart.
1
Add or update items
Use Setting
POST /cart/items to append new products. The response returns added_products, updated_products, and a cart_summary with totals.checkVariantAvailability to true instructs Henry to trigger the experimental variant validation service. Any pending checks appear under data.variant_checks with a variantCheckRequestId.2
Remove individual products
When a shopper deletes one line item, call
DELETE /cart/items/{productId}. The productId value must match the ID you originally supplied or the ID returned from the initial POST /cart/items call.3
Clear the cart
To reset the cart entirely, use
DELETE /cart/items. The response confirms the cart is empty, which is useful when a user logs out. The cart is automatically cleared when the user completes a checkout.Reuse the same
x-user-id in downstream checkout calls so Henry can hydrate
the cart automatically when you initiate a hosted session or build a headless
flow.Troubleshooting
400 Bad Request– validate price formatting (stringin the schema) and ensure the quantity is greater than zero.404 Cart already empty– only occurs when clearing an empty cart; you can safely ignore it in idempotent flows.- Variant check requests require polling via
GET /products/variant-check/{id}for a definitive in-stock answer.

