Cart Items Mutations

CreateCartItems

Adds one or multiple new items to the B2B store cart.

Parameters:

ParameterTypeDescription
inputCartItemsInput!Data holding the list of variants and quantities.
currencyString!The selected currency.
price_level_idInt!Price level applied.
location_ids[Int!]!List of selected locations.
exchange_rateFloat!Active exchange rate.
customer_idIntTarget customer.

Example Query:

mutation CreateCartItems(
  $input: CartItemsInput!,
  $currency: String!,
  $price_level_id: Int!,
  $location_ids: [Int!]!,
  $exchange_rate: Float!
) {
  CreateCartItems(
    input: $input,
    currency: $currency,
    price_level_id: $price_level_id,
    location_ids: $location_ids,
    exchange_rate: $exchange_rate
  ) {
    id
    variant { id }
    quantity
  }
}

UpdateCartItems

Updates quantities or variants in the existing cart.

Parameters:

ParameterTypeDescription
inputCartItemsInput!Updated data.
currencyString!Same arguments as CreateCartItems.
price_level_idInt!ID.
location_ids[Int!]!IDs.
exchange_rateFloat!Rate.
customer_idIntOptional customer.

Example Query:

mutation UpdateCartItems($input: CartItemsInput!, $currency: String!, $price_level_id: Int!, $location_ids: [Int!]!, $exchange_rate: Float!) {
  UpdateCartItems(input: $input, currency: $currency, price_level_id: $price_level_id, location_ids: $location_ids, exchange_rate: $exchange_rate) {
    id
    quantity
  }
}

DeleteCartItem

Deletes a specific item from the cart.

Parameters:

ParameterTypeDescription
idInt!ID of the cart item.

ClearCartItems

Clears all items from the active B2B store cart.

Parameters:

ParameterTypeDescription
profile_idIDID of the specific B2B user profile to clear the cart for (optional).

Input Data Types

CartItemInput

FieldTypeDescription
idIDID of the existing cart item.
uuidStringExternal frontend UUID if needed.
variantVariantInputContains variant ID.
component_parentVariantInputIf adding a component of a kit.
quantityFloatMain quantity requested.
component_quantityFloatSubelement's requested quantity.
typeCartItemTypeIdentifies variant, kit, or component.

CartItemsInput

FieldTypeDescription
data[CartItemInput]Array of cart items inputs.

Enums

CartItemType

ValueDescription
variantStandard product variant.
kitAssembly/Kit.
packagingPackaging variant.
componentSub-item of a kit or assembly.