> 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.

# createCart

GraphQL MUTATION

Creates a cart and generates a cart ID.

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

## GraphQL Schema

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

## Variables

```json
{
  "input": {
    "lineItems": [
      {
        "quantity": 0,
        "productEntityId": 0,
        "variantEntityId": 0,
        "sku": "example",
        "selectedOptions": {
          "checkboxes": [
            {
              "optionEntityId": 0,
              "optionValueEntityId": 0
            }
          ],
          "dateFields": [
            {
              "optionEntityId": 0,
              "date": "2026-10-23T21:25:00.312Z"
            }
          ],
          "multiLineTextFields": [
            {
              "optionEntityId": 0,
              "text": "example"
            }
          ],
          "multipleChoices": [
            {
              "optionEntityId": 0,
              "optionValueEntityId": 0
            }
          ],
          "numberFields": [
            {
              "optionEntityId": 0,
              "number": 0
            }
          ],
          "textFields": [
            {
              "optionEntityId": 0,
              "text": "example"
            }
          ]
        }
      }
    ],
    "giftCertificates": [
      {
        "name": "example",
        "theme": "BIRTHDAY",
        "amount": "example",
        "quantity": 0,
        "sender": {
          "name": "example",
          "email": "example"
        },
        "recipient": {
          "name": "example",
          "email": "example"
        },
        "message": "example"
      }
    ],
    "currencyCode": "example",
    "locale": "example",
    "externalSource": "example"
  }
}
```