Part of our app creates orders in a retailer's store via Shopify's API. We ran into a case today where an order is failing to create because the Shopify API says the billing and shipping address country can't be blank. The data we're sending to the API does indeed have a country specified:
{
"billing_address": {
"province": "Singapore",
"city": "Singapore",
"name": "-- --",
"zip": "-----",
"address1": "--------",
"address2": "-----",
"phone": "-",
"country": "Singapore"
},
"billing_address": {
"province": "Singapore",
"city": "Singapore",
"name": "-- --",
"zip": "-----",
"address1": "--------",
"address2": "-----",
"phone": "-",
"country": "Singapore"
}
}
No matter what I send the API, it responds with:
{"errors":{"billing_address":["Country can't be blank"],"shipping_address":["Country can't be blank"]}}
Am I missing something?
I am currently facing a similar issue:
1. I notice that there is now a field called 'country_name':
"order" : {
"billing_address" : {
"zip" : "48025-2205",
"first_name" : "xxx",
"country" : "United States",
"last_name" : "xxx",
"province_code" : "MI",
"country_name" : "",...
"shipping_address" : {
"zip" : "48025-2205",
"first_name" : "xxx",
"country" : "United States",
"last_name" : "xxx",
"province_code" : "MI",
"country_name" : "",
Try adding this field and including the country again.
Also see this thread which implies that if a country is not set up in the Shipping Preferences, you cannot create an order for it with the API (I have not verified this myself):
User | Count |
---|---|
12 | |
12 | |
10 | |
7 | |
6 |