A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi,
I am executing a companyCreate mutation using the Shopify GraphiQL App, however I get an error on path "input.companyLocation.billingAddress" which isn't that descriptive: "Invalid input.". Below is the query, variables and response, what could be the issue here?
Query:
mutation companyCreate($input: CompanyCreateInput!) {
companyCreate(input: $input) {
company {
id
}
userErrors {
code
field
message
}
}
}
Variables:
{
"input": {
"company": {
"customerSince": "2022-08-30",
"externalId": "",
"name": "Better Call Saul",
"note": "Speedy justice for you"
},
"companyContact": {
"email": "justiceforyou@bettercallsaul.com",
"firstName": "Saul",
"lastName": "Goodman",
"locale": "en_US",
"phone": "+15058425662",
"title": ""
},
"companyLocation": {
"billingAddress": {
"address1": "9800 Montgomery Boulevard",
"address2": "",
"city": "Albuquerque",
"countryCode": "US",
"firstName": "Saul",
"lastName": "Goodman",
"phone": "+15058425662",
"zip": "87111",
"zoneCode": "NM"
},
"billingSameAsShipping": true,
"buyerExperienceConfiguration": {
"checkoutToDraft": true
},
"externalId": "",
"locale": "en_US",
"name": "Saul Goodman",
"note": "",
"phone": "+15058425662",
"taxExemptions": [],
"taxRegistrationId": ""
}
}
}
Response:
{
"data": {
"companyCreate": {
"company": null,
"userErrors": [
{
"code": "INVALID_INPUT",
"field": [
"input",
"companyLocation",
"billingAddress"
],
"message": "Invalid input."
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1990,
"restoreRate": 100
}
}
}
}
I'm having the exact same issue. Did you ever resolve this?
I am having the same issue. userErrors only says INVALID_INPUT
frustrating - exact same error - this must be an issue
Hey @Frank01 , @ftballguy45 , and @fortuna-001
The docs for companyCreate do say that the mutation is only available on Plus stores, but the issue with the code above is that the CompanyCreateInput.
companyLocation.billingSameAsShipping field is set to true, which means the required Billing address is ignored and there is no Shipping address to add the necessary info:
I will flag this with our developers to request that a clearer error message gets raised if no address is provided.
All the best.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi,
Exactly, I have same issue. After removing the first name and last name fields from billing and shipping addresses the issue was fixed.