---
title: CartInput - Storefront API
description: >-
  The input fields for creating a

  [`Cart`](/docs/api/storefront/2026-10/objects/Cart). Used by the
  [`cartCreate`](/docs/api/storefront/2026-10/mutations/cartCreate) mutation.


  Accepts merchandise lines, discount codes, gift card codes, and a note. You
  can

  also set custom attributes, metafields, buyer identity for international

  pricing, and delivery addresses.
api_version: 2026-10
source_url:
  html: 'https://shopify.dev/docs/api/storefront/latest/input-objects/CartInput'
  md: 'https://shopify.dev/docs/api/storefront/latest/input-objects/CartInput.md'
api_name: storefront
api_type: graphql
type: input-object
---

# Cart​Input

input\_object

The input fields for creating a [`Cart`](https://shopify.dev/docs/api/storefront/2026-10/objects/Cart). Used by the [`cartCreate`](https://shopify.dev/docs/api/storefront/2026-10/mutations/cartCreate) mutation.

Accepts merchandise lines, discount codes, gift card codes, and a note. You can also set custom attributes, metafields, buyer identity for international pricing, and delivery addresses.

## Fields

* attributes

  [\[Attribute​Input!\]](https://shopify.dev/docs/api/storefront/latest/input-objects/AttributeInput)

  An array of key-value pairs that contains additional information about the cart.

  The input must not contain more than `250` values.

* buyer​Identity

  [Cart​Buyer​Identity​Input](https://shopify.dev/docs/api/storefront/latest/input-objects/CartBuyerIdentityInput)

  The customer associated with the cart. Used to determine \[international pricing] (<https://shopify.dev/custom-storefronts/internationalization/international-pricing>). Buyer identity should match the customer's shipping address.

* delivery

  [Cart​Delivery​Input](https://shopify.dev/docs/api/storefront/latest/input-objects/CartDeliveryInput)

  The delivery-related fields for the cart.

* discount​Codes

  [\[String!\]](https://shopify.dev/docs/api/storefront/latest/scalars/String)

  The case-insensitive discount codes that the customer added at checkout.

  The input must not contain more than `250` values.

* gift​Card​Codes

  [\[String!\]](https://shopify.dev/docs/api/storefront/latest/scalars/String)

  The case-insensitive gift card codes.

  The input must not contain more than `250` values.

* lines

  [\[Cart​Line​Input!\]](https://shopify.dev/docs/api/storefront/latest/input-objects/CartLineInput)

  A list of merchandise lines to add to the cart.

  The input must not contain more than `250` values.

* metafields

  [\[Cart​Input​Metafield​Input!\]](https://shopify.dev/docs/api/storefront/latest/input-objects/CartInputMetafieldInput)

  The metafields to associate with this cart.

  The input must not contain more than `250` values.

* note

  [String](https://shopify.dev/docs/api/storefront/latest/scalars/String)

  A note that's associated with the cart. For example, the note can be a personalized message to the buyer.

* source​Name

  [String](https://shopify.dev/docs/api/storefront/latest/scalars/String)

  The source name of the channel to use for order attribution. The value must match the source name of a channel that the client, identified by the storefront access token, owns.

***

## Mutations using this input

* [cart​Create.input](https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate#arguments-input)

  ARGUMENT

***

## Map

### Mutations using this input

* [cart​Create.input](https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate#arguments-input)
