this is my mutation for create checkout:
mutation checkoutCreate($input: CheckoutCreateInput!) {
checkoutCreate(input: $input) {
checkout {
id
}
checkoutUserErrors {
code
field
message
}
queueToken
}
}
and input variables is :
{
"input": {
"allowPartialAddresses": false,
"buyerIdentity": {
"countryCode": "AU"
},
"customAttributes": [
{
"key": "",
"value": ""
}
],
"email": "Karimy.ehsan@gmail.com",
"note": "test",
"presentmentCurrencyCode": "AU",
"shippingAddress": {
"address1": "15 Barker Street",
"address2": "",
"city": "Forest Hill",
"company": "",
"country": "Australia",
"firstName": "Ehsan",
"lastName": "karimi",
"phone": "(08) 9073 4623",
"province": "Western Australia",
"zip": "6324"
},
"lineItems": [
{
"customAttributes": [
{
"key": "",
"value": ""
}
],
"quantity": 1,
"variantId": "gid://shopify/ProductVariant/46850414182711"
}
]
},
"queueToken": ""
}
and response error is :
{
"errors": [
{
"message": "CheckoutCreateInput isn't a defined input type (on $input)",
"locations": [
{
"line": 1,
"column": 25
}
],
"path": [
"mutation checkoutCreate"
],
"extensions": {
"code": "variableRequiresValidType",
"typeName": "CheckoutCreateInput",
"variableName": "input"
}
},
{
"message": "Field 'checkoutCreate' doesn't exist on type 'Mutation'",
"locations": [
{
"line": 3,
"column": 15
}
],
"path": [
"mutation checkoutCreate",
"checkoutCreate"
],
"extensions": {
"code": "undefinedField",
"typeName": "Mutation",
"fieldName": "checkoutCreate"
}
},
{
"message": "Variable $input is declared by checkoutCreate but not used",
"locations": [
{
"line": 1,
"column": 1
}
],
"path": [
"mutation checkoutCreate"
],
"extensions": {
"code": "variableNotUsed",
"variableName": "input"
}
}
]
}
the post URL is : https://fydez.myshopify.com/admin/api/2023-07/graphql.json
I don’t know why receiving this error!!!