Ad

On Inserting Province/state On Orders Using Shopify API

- 1 answer

I can't seem to insert the state name or code on API orders in Shopify.

When I use this to create an order using API.

  "shipping_address" : {
    "first_name" : "Ajo",
    "last_name" : "Fod",
    "address1" : "90 selwyn rd",
    "address2" : "",
    "city" : "Braintree ",
    "province" : "Ma",
    "zip" : "02184",
    "country" : "Usa",
    "province_code" : "MA"
  },

I get this in the order dashboard on Shopify:

NO State/province information

Why is the state code missing?

How do I get the state code back in there?

Ad

Answer

The countries and provinces are validated. Instead of Usa try using US or another ISO 3166-1 alpha-2 country code.

Ad
source: stackoverflow.com
Ad