Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

get error when try to create cart with storefront api

Rakibul_Hasan
Visitor
3 0 0

i use this mutation to create the cart:

mutation createCart {
    cartCreate(
      input: {
        buyerIdentity: {
          email: "example-email@example.com"
          customerAccessToken: "f08ec7d6418751178caa565233"
        }
        lines: [
          { quantity: 2, merchandiseId: "gid://shopify/Product/8318551621920" }
        ]
      }
    ) {
      cart {
        buyerIdentity {
          email
        }
        lines(first: 10) {
          edges {
            node {
              quantity
            }
          }
        }
      }
    }
  }

 when i use this in shopify graphiql playground  get the given below error:  

{
  "data": {
    "cartCreate": null
  },
  "errors": [
    {
      "message": "invalid id",
      "locations": [
        {
          "line": 2,
          "column": 5
        }
      ],
      "path": [
        "cartCreate"
      ]
    }
  ]
}

it said invalid id but I am not able to find which wrong id I am providing. Please someone help me to solve the error

Replies 0 (0)