Skip to content

shoppingListLineItemsAdd

Mutationin Shopping lists

Add products to a shopping list Note: "id" is optional for B2C/anonymous users - if not provided, a new list is created

Arguments

ArgumentTypeDescription
lineItems[ShoppingListLineItemAddInput!]!
idID

Returns

ShoppingListLineItemsAddResponse!

FieldTypeDescription
shoppingListShoppingListUpdated shopping list information after line item operation
shoppingListErrors[ShoppingListLineItemsAddError!]Error details if line item operation failed

Example

mutation {
shoppingListLineItemsAdd(
id: "sl-123"
lineItems: [
{
sku: "SKU-001"
quantity: 2
},
{
sku: "SKU-002"
quantity: 1
}
]
) {
shoppingList {
id
lineItems {
id
slug
quantity
}
}
}
}

The query is the example the schema documents. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaResolved
@evolve-framework/sfccStub: answers Not implemented

Used by

The storefront packages that send it, in these GraphQL documents: