When trying to create a draft order through the Graph QL API I am getting the error returned as;
{
"draftOrderCreate": {
"draftOrder": null,
"userErrors": [
{
"field": [
"email"
],
"message": "Email is invalid",
"__typename": "UserError"
}
],
"__typename": "DraftOrderCreatePayload"
}
}
The odd thing is this is a customer that already exists on the store - and has placed orders in the past.
In the create payload I am sending both the Customer ID in the purchasingEntity field as well as the email in the “email” field.
Also, strangely, the draft order can be created through the Admin interface no problem.
The email looks inconspicuous and is a normal “@gmail.com” email. I can see in the timeline of the customer that emails have been sending normally.
I tried just sending the customerId in purchasingEntity and not including the email and that actually seemed to work fine - so there is a work around, but still strange.