regions

Description

This property helper gives you all the regions for a given country. Be default, it shows regions for the United States. To view regions from another country, include the country_code in the URL with the 2 character country code. Example, to view Canadian regions, use ?country_code=CA.

The values JSON object has the following properties

  • default: The default name for this region.
  • code: The code for this region.
  • cc3: The official 3 character country code.
  • alternate_values: Array of alternative names for this region.
  • boost: This value determines which regions will show up first in our find-as-you-type system.
  • active: (boolean) if this region is currently recognized.

Interact with this resource

To interact with this resource and see it in the context of the API, you can utilise Postman or your Terminal/Console to perform requests. If you have a Foxy store, you can also use the API browser in the admin to interact with resources connected to your store.

Actions

GET
View a regions
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Properties

Property Description Type Constraints
message A small, human readable explanation of this property helper. String Read only
values JSON objects with the region codes as the keys. JSON Read only

Example Representation

{
    "_links": {
        "curies": [
            {
                "name": "fx",
                "href": "https://api.foxycart.com/rels/{rel}",
                "templated": true
            }
        ],
        "self": {
            "href": "https://api.foxycart.com/property_helpers/regions",
            "title": "List of valid region values. It defaults to US states, but you can filter for other country states using ?country_code="
        },
        "fx:countries": {
            "href": "https://api.foxycart.com/property_helpers/countries",
            "title": "List of valid country values for any country setting such as the Store resource store_country."
        },
        "fx:property_helpers": {
            "href": "https://api.foxycart.com/property_helpers",
            "title": "Property Helpers Home"
        }
    },
    "message": "The values listed here are the correct values for the Store store_state field for the given country code. The values are listed in the format value => description. If no values are specified, any store_state value can be used for this country code.",
    "values": {
        "AL": {
            "default": "Alabama",
            "code": "AL",
            "alternate_values": [
            ],
            "boost": "",
            "active": true
        },
        "AK": {
            "default": "Alaska",
            "code": "AK",
            "alternate_values": [
            ],
            "boost": "",
            "active": true
        },
        ...
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api.foxycart.com/property_helpers/regions">
  <link rel="self" href="https://api.foxycart.com/property_helpers/regions" title="List of valid region values. It defaults to US states, but you can filter for other country states using ?country_code=&amp;lt;valid country code&amp;gt;"/>
  <link rel="https://api.foxycart.com/rels/countries" href="https://api.foxycart.com/property_helpers/countries" title="List of valid country values for any country setting such as the Store resource store_country."/>
  <link rel="https://api.foxycart.com/rels/property_helpers" href="https://api.foxycart.com/property_helpers" title="Property Helpers Home"/>
  <message>The values listed here are the correct values for the Store store_state field for the given country code. The values are listed in the format value =&amp;gt; description. If no values are specified, any store_state value can be used for this country code.</message>
  <values>
    <AL>
      <default>Alabama</default>
      <code>AL</code>
      <alternate_values/>
      <boost></boost>
      <active>true</active>
    </AL>
    <AK>
      <default>Alaska</default>
      <code>AK</code>
      <alternate_values/>
      <boost></boost>
      <active>true</active>
    </AK>
    ...
  </values>
</resource>
{
    "properties": {
        "message": "The values listed here are the correct values for the Store store_state field for the given country code. The values are listed in the format value => description. If no values are specified, any store_state value can be used for this country code.",
        "values": {
            "AL": {
                "default": "Alabama",
                "code": "AL",
                "alternate_values": [
                ],
                "boost": "",
                "active": true
            },
            "AK": {
                "default": "Alaska",
                "code": "AK",
                "alternate_values": [
                ],
                "boost": "",
                "active": true
            },
            ...
        }
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api.foxycart.com/property_helpers/regions"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/countries"
            ],
            "href": "https://api.foxycart.com/property_helpers/countries"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/property_helpers"
            ],
            "href": "https://api.foxycart.com/property_helpers"
        }
    ]
}

Zoomable Resources

This resource has no linked resources which can be "zoomed" in on, filtered and embedded within this resource.