> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# addCartLineItems

GraphQL MUTATION

Adds line item(s) to the cart.

Reference: https://docs.bigcommerce.com/developer/api-reference/graphql/storefront/mutations/cart/add-cart-line-items

## GraphQL Schema

```graphql
mutation ExampleMutation($input: AddCartLineItemsInput!) {
  cart {
    addCartLineItems(input: $input) {
      cart {
        id
        entityId
        currencyCode
        displayCurrencyCode
        isTaxIncluded
        baseAmount
        baseAmountInDisplayCurrency
        discountedAmount
        discountedAmountInDisplayCurrency
        amount
      }
    }
  }
}
```

## Variables

```json
{
  "input": {
    "cartEntityId": "example",
    "data": {
      "lineItems": [
        {
          "quantity": 0,
          "productEntityId": 0,
          "variantEntityId": 0,
          "sku": "example",
          "selectedOptions": {
            "checkboxes": [
              {
                "optionEntityId": null,
                "optionValueEntityId": null
              }
            ],
            "dateFields": [
              {
                "optionEntityId": null,
                "date": null
              }
            ],
            "multiLineTextFields": [
              {
                "optionEntityId": null,
                "text": null
              }
            ],
            "multipleChoices": [
              {
                "optionEntityId": null,
                "optionValueEntityId": null
              }
            ],
            "numberFields": [
              {
                "optionEntityId": null,
                "number": null
              }
            ],
            "textFields": [
              {
                "optionEntityId": null,
                "text": null
              }
            ]
          }
        }
      ],
      "giftCertificates": [
        {
          "name": "example",
          "theme": "BIRTHDAY",
          "amount": "example",
          "quantity": 0,
          "sender": {
            "name": "example",
            "email": "example"
          },
          "recipient": {
            "name": "example",
            "email": "example"
          },
          "message": "example"
        }
      ]
    },
    "version": 0
  }
}
```