Hi!
I am encountering an issue with the Draft Orders API endpoint (/admin/api/2024-01/draft_orders.json). When creating a draft order for a customer with a government email address (e.g., [email removed] I receive the following error:
{“errors”:{“email”:[“contains an invalid domain name”]}}
This is perplexing because I can successfully create the customer using the Customers API endpoint (/admin/api/2023-07/customers.json) with the same email address. There seems to be a discrepancy in how the two endpoints handle government domain names.
The JSON body used for creating the draft order is as follows:
{
"draft_order": {
"line_items": [{ "title": "Custom Tee", "price": "20.00", "quantity": 2 }],
"applied_discount": {
"description": "Custom discount",
"value_type": "fixed_amount",
"value": "10.0",
"amount": "10.00",
"title": "Custom"
},
"tags": "Clinique, <sales_rep>",
"customer": { "id": 'customerId' },
"billing_address": {
"first_name": "Bob",
"last_name": "Norman",
"address1": "123 Main St",
"city": "Anytown",
"province": "ON",
"country": "Canada",
"zip": "A1B2C3",
"phone": "555-555-5555"
},
"shipping_address": {
"first_name": "Bob",
"last_name": "Norman",
"address1": "123 Main St",
"city": "Anytown",
"province": "ON",
"country": "Canada",
"zip": "A1B2C3",
"phone": "555-555-5555"
}
}
}
Could you please assist in resolving this issue or provide guidance on how to handle government email domains in draft orders?
Thank you for your assistance.
Best regards,