Anchor to section titled 'undefined'

checkoutCreate
mutation
deprecated

Requires unauthenticated_write_checkouts access scope.

Creates a new checkout. The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.


The fields used to create a checkout.

The checkout queue token. Available only to selected stores.


Was this section helpful?

The new checkout object.

The list of errors that occurred from executing the mutation.

The checkout queue token. Available only to selected stores.

The list of errors that occurred from executing the mutation. Use checkoutUserErrors instead.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation checkoutCreate($input: CheckoutCreateInput!) {
  checkoutCreate(input: $input) {
    checkout {
      # Checkout fields
    }
    checkoutUserErrors {
      # CheckoutUserError fields
    }
    queueToken
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "input": {
    "allowPartialAddresses": true,
    "buyerIdentity": {
      "countryCode": "AC"
    },
    "customAttributes": [
      {
        "key": "<your-key>",
        "value": "<your-value>"
      }
    ],
    "email": "<your-email>",
    "lineItems": [
      {
        "customAttributes": [
          {
            "key": "<your-key>",
            "value": "<your-value>"
          }
        ],
        "quantity": 1,
        "variantId": "gid://shopify/<objectName>/10079785100"
      }
    ],
    "note": "<your-note>",
    "shippingAddress": {
      "address1": "<your-address1>",
      "address2": "<your-address2>",
      "city": "<your-city>",
      "company": "<your-company>",
      "country": "<your-country>",
      "firstName": "<your-firstName>",
      "lastName": "<your-lastName>",
      "phone": "<your-phone>",
      "province": "<your-province>",
      "zip": "<your-zip>"
    }
  },
  "queueToken": "<your-queueToken>"
}
input CheckoutCreateInput {
  allowPartialAddresses: Boolean
  buyerIdentity: CheckoutBuyerIdentityInput
  customAttributes: [AttributeInput!]
  email: String
  lineItems: [CheckoutLineItemInput!]
  note: String
  presentmentCurrencyCode: CurrencyCode
  shippingAddress: MailingAddressInput
}

input CheckoutBuyerIdentityInput {
  countryCode: CountryCode!
}

input AttributeInput {
  key: String!
  value: String!
}

input CheckoutLineItemInput {
  customAttributes: [AttributeInput!]
  quantity: Int!
  variantId: ID!
}

input MailingAddressInput {
  address1: String
  address2: String
  city: String
  company: String
  country: String
  firstName: String
  lastName: String
  phone: String
  province: String
  zip: String
}