Skip to main content

CartUpsertItemsByProductIdInput

Input for upserting cart items by product.

Every line is matched against the cart's plain lines by productId and either replaces that line's quantity or is created. The whole set is applied in one pass and the cart is recalculated once, so this is the call to use for a standing order or a basket sync instead of firing one cartAddItem per product.

input CartUpsertItemsByProductIdInput {
items: [CartUpsertItemByProductIdInput!]!
}

Fields​

CartUpsertItemsByProductIdInput.items ● [CartUpsertItemByProductIdInput!]! non-null input​

Collection of product lines to upsert.

Must contain at least one line and at most 500. Each productId may appear only once — it is the match key, so a second line for it would contradict the first. Lines already in the cart that are not mentioned here are left alone: this is not a whole-cart replace, so a larger set can be sent as several calls in any order.

Member Of​

cartUpsertItemsByProductId mutation