Hi all, I’m trying to create a draft order with the GraphQL Admin API, draftOrderCreate. I’m sending in a single lineItem with a quantity and a title only, but I keep keeping an error:
The merchandise variant referenced by this term condition could not be found.
The documentation makes it seem like I can send custom item lines without specifying a variantId.
Example query:
{
"query": "\nmutation CreateDraftOrder ($input: DraftOrderInput!) {\n\tdraftOrderCreate(input: $input) {\n\t\tdraftOrder {\n\t\t\tid\n\t\t\tstatus\n\t\t}\n\t\tuserErrors {\n\t\t\tfield\n\t\t\tmessage\n\t\t}\n\t}\n}\n",
"variables": {
"input": {
"billingAddress": {
"address1": "123 TRILLIUM AVE",
"city": "SARASOTA",
"countryCode": "US",
"firstName": "JOHN",
"lastName": "SMITH",
"phone": "9412045555",
"provinceCode": "FL",
"zip": "34241-5204"
},
"email": "jsmith@aim.com",
"lineItems": [
{
"quantity": 1,
"title": "Funko Pop! Advent Calendar: Harry Potter 2022"
}
],
"shippingAddress": {
"address1": "123 Trillium Ave",
"city": "Sarasota",
"countryCode": "US",
"firstName": "John",
"lastName": "Smith",
"phone": "9412045555",
"provinceCode": "FL",
"zip": "34241-5204"
}
}
},
"operationName": "CreateDraftOrder"
}