--- title: cartCreate - Storefront API description: Creates a new cart. api_version: 2025-10 api_name: storefront type: mutation api_type: graphql source_url: html: https://shopify.dev/docs/api/storefront/latest/mutations/cartcreate md: https://shopify.dev/docs/api/storefront/latest/mutations/cartcreate.md --- # cart​Create mutation Creates a new cart. ## Arguments * input [Cart​Input](https://shopify.dev/docs/api/storefront/latest/input-objects/CartInput) The fields used to create a cart. *** ## Cart​Create​Payload returns * cart [Cart](https://shopify.dev/docs/api/storefront/latest/objects/Cart) The new cart. * user​Errors [\[Cart​User​Error!\]!](https://shopify.dev/docs/api/storefront/latest/objects/CartUserError) non-null The list of errors that occurred from executing the mutation. * warnings [\[Cart​Warning!\]!](https://shopify.dev/docs/api/storefront/latest/objects/CartWarning) non-null A list of warnings that occurred during the mutation. *** ## Examples * ### cartCreate reference ## Mutation Reference ```graphql mutation cartCreate($input: CartInput) { cartCreate(input: $input) { cart { # Cart fields } userErrors { field message } warnings { # CartWarning fields } } } ``` ## Input ```json { "input": { "attributes": [ { "key": "", "value": "" } ], "lines": [ { "attributes": [ {} ], "quantity": 1, "merchandiseId": "gid://shopify//10079785100", "sellingPlanId": "gid://shopify//10079785100", "parent": {} } ], "discountCodes": [ "" ], "giftCardCodes": [ "" ], "note": "", "buyerIdentity": { "email": "", "phone": "", "companyLocationId": "gid://shopify//10079785100", "countryCode": "AF", "customerAccessToken": "", "preferences": {} }, "delivery": { "addresses": [ {} ] }, "metafields": [ { "key": "", "value": "", "type": "" } ] } } ```