GET
/
api
/
v2
/
storefront
/
countries
/
{iso}
curl --request GET \
  --url https://demo.spreecommerce.org/api/v2/storefront/countries/{iso}
{
  "data": {
    "id": "1",
    "type": "country",
    "attributes": {
      "iso": "US",
      "iso3": "USA",
      "iso_name": "UNITED STATES",
      "name": "United States",
      "states_required": true,
      "zipcode_required": true,
      "default": true
    },
    "relationships": {
      "states": {
        "data": [
          {
            "abbr": "NY",
            "name": "New York"
          }
        ]
      }
    }
  },
  "included": [
    {
      "abbr": "NY",
      "name": "New York"
    }
  ]
}

Path Parameters

iso
string
required

Provide a Country ISO US or ISO3 USA code.

Query Parameters

include
string

Specify the related resources you would like to receive in the response body. More Information.

fields[country]
string

Specify the fields you would like returned in the response body. More information.

Response

200
application/vnd.api+json
200 Success - Returns the `country` object.
data
object
required

Countries within Spree are used as a container for states. Countries can be zone members, and also link to an address. The difference between one country and another on an address record can determine which tax rates and shipping methods are used for the order.Read more about Countries in Spree

included
object[]

States within Spree are used to scope address data slightly more than country. States are useful for tax purposes, as different states in a country may impose different tax rates on different products. In addition to this, different states may cause different tax rates and shipping methods to be used for an order, similar to how countries affect it also.