Can't Create A Cart Through Storefront Api GraphQL Request

Topic summary

A developer is unable to create a cart using the Shopify Storefront API GraphQL mutation cartCreate. The request returns an INTERNAL_SERVER_ERROR with the cart object as null, despite using what appears to be a valid mutation structure.

Key Details:

  • API version: 2023-01
  • Error: Internal server error (Request ID: e83d6aaf-23e0-413f-866c-2b88fa5b7e50)
  • The identical GraphQL mutation works successfully on a demo store (hydrogen-sanity-demo.com) but fails on their production store
  • Only difference between working and failing requests is the ProductVariant ID being used

Current Status:

  • The developer suspects an issue on their store’s end rather than with the query itself
  • Seeking information on how to troubleshoot the INTERNAL_SERVER_ERROR
  • No responses or solutions have been provided yet

The mutation includes standard cart operations: creating a cart with line items, buyer identity (country code), and retrieving cart details including checkout URL, quantities, pricing, and product variant information.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

Request ID:

e83d6aaf-23e0-413f-866c-2b88fa5b7e50

URL: https:// **- .myshopify.com/api/2023-01/graphql.json

I’m trying to create a cart through a GraphQL request with no luck. I’ve tried the same request on a Demo store (https://hydrogen-sanity-demo.com/)) and everything worked as expected. The exact same request (obviously different ProductVariant ID) does not work on our store, with the cart being returned as null.
The request:

mutation CartCreate($input: CartInput!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {
  cartCreate(input: $input) {
    cart {
      ...CartFragment
    }
    userErrors { field message }
  }
}

fragment CartFragment on Cart {
  id
  checkoutUrl
  totalQuantity
  buyerIdentity {
    countryCode
    customer {
      id
      email
      firstName
      lastName
      displayName
    }
    email
    phone
  }
  lines(first: $numCartLines) {
    edges {
      node {
        id
        quantity
        attributes {
          key
          value
        }
        cost {
          totalAmount {
            amount
            currencyCode
          }
          compareAtAmountPerQuantity {
            amount
            currencyCode
          }
        }
        merchandise {
          ... on ProductVariant {
            id
            availableForSale
            compareAtPriceV2 {
              ...MoneyFragment
            }
            priceV2 {
              ...MoneyFragment
            }
            requiresShipping
            title
            image {
              ...ImageFragment
            }
            product {
              handle
              title
              id
            }
            selectedOptions {
              name
              value
            }
          }
        }
      }
    }
  }
  cost {
    subtotalAmount {
      ...MoneyFragment
    }
    totalAmount {
      ...MoneyFragment
    }
    totalDutyAmount {
      ...MoneyFragment
    }
    totalTaxAmount {
      ...MoneyFragment
    }
  }
  note
  attributes {
    key
    value
  }
  discountCodes {
    code
  }
}

fragment MoneyFragment on MoneyV2 {
  currencyCode
  amount
}
fragment ImageFragment on Image {
  id
  url
  altText
  width
  height
}

Variables:

{
  "input": {
    "lines": [
      {
        "quantity": 1,
        "merchandiseId": "gid://shopify/ProductVariant/***"
      }
    ],
    "buyerIdentity": {
      "countryCode": "US"
    }
  },
  "country": "US"
}

Response:

{
  "errors": [
    {
      "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: e83d6aaf-23e0-413f-866c-2b88fa5b7e50 (include this in support requests).",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "requestId": "e83d6aaf-23e0-413f-866c-2b88fa5b7e50"
      }
    }
  ]
}

I’m assuming something is wrong on our end, as it does work OK on demo store.
Is it possible to get more information on the error above, as INTERNAL_SERVER_ERROR is not very helpful.