Shopify API – Country

top

Receive a list of all Countries

Get a list of all countries

GET /admin/countries.xml

Get all countries

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<countries type="array">
  <country>
    <code>CA</code>
    <id type="integer">879921426</id>
    <name>Canada</name>
    <tax type="float">0.05</tax>
  </country>
</countries>
top

Receive a count of all Countries

Get a count of all countries

GET /admin/countries/count.xml

Count all countries

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<count type="integer">1</count>
top

Receive a single Country

Show country

GET /admin/countries/#{id}.xml

Show country

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<country>
  <code>CA</code>
  <id type="integer">879921426</id>
  <name>Canada</name>
  <tax type="float">0.05</tax>
</country>
top

Create a new Country

Create a country

POST /admin/countries.xml

Create a country using Shopify's tax rate for the country

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<country>
  <code>FR</code>
</country>      

Response

           
HTTP/1.1 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<country>
  <code>FR</code>
  <id type="integer">1727409732</id>
  <name>France</name>
  <tax type="float">0.196</tax>
</country>
POST /admin/countries.xml

Create a country using a custom tax rate

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<country>
  <tax type="float">0.2</tax>
  <code>FR</code>
</country>      

Response

           
HTTP/1.1 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<country>
  <code>FR</code>
  <id type="integer">1727409733</id>
  <name>France</name>
  <tax type="float">0.2</tax>
</country>
top

Modify an existing Country

Update a country

PUT /admin/countries/#{id}.xml

Update the country's tax rate

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<country>
  <tax type="float">0.1</tax>
  <id type="integer">879921426</id>
</country>      

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<country>
  <code>CA</code>
  <id type="integer">879921426</id>
  <name>Canada</name>
  <tax type="float">0.1</tax>
</country>
top

Remove a Country from the database

Delete a country

DELETE /admin/countries/#{id}.xml

Delete a country along with all shipping rates

Response

           
HTTP/1.1 200 OK
Last updated at Oct 2009 Oct:10 AM.