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.