Overview


ACME has APIs available on both B2C and B2B to get state and country data in the format ACME supports. Using these APIs to build out state and country selection drop downs pre-defined pick lists offers a few benefits:


  1. Improved user experience by allowing users to select their state and country instead of having to type it in
  2. Consistent data entry
  3. Assurance that the state and country data is in the correct format for ACME to handle it (if data is not in the correct format than uses may have to re-enter the data in ACME). In checkout, send the value from the "name" field.


We recommend defaulting country drop downs to the country where the venue is located since most visitors are local and putting the venue's country at the top of the pick list for ease of use. 





TABLE OF CONTENTS



Countries


GET 
/v2/b2c/locations/avs/countries
OR
/v2/b2b/locations/avs/countries



Sample Response:

[
    {
        "name": "United States",
        "alpha2Code": "US",
        "alpha3Code": "USA",
        "abbreviation": "US",
        "numericCode": "840",
        "es": "Estados Unidos",
        "currency": "USD",
        "capital": "Washington, D.C."
    },
    {
        "name": "Canada",
        "alpha2Code": "CA",
        "alpha3Code": "CAN",
        "abbreviation": "CA",
        "numericCode": "124",
        "es": "Canadá",
        "currency": "CAD",
        "capital": "Ottawa"
    },
    {
        "name": "Afghanistan",
        "alpha2Code": "AF",
        "alpha3Code": "AFG",
        "abbreviation": "AF",
        "numericCode": "004",
        "es": "Afganistán",
        "currency": "AFN",
        "capital": "Kabul"
    },
    ...
{
        "name": "Zimbabwe",
        "alpha2Code": "ZW",
        "alpha3Code": "ZWE",
        "abbreviation": "ZW",
        "numericCode": "716",
        "es": "Zimbabue",
        "currency": "USD",
        "capital": "Harare"
    }
]


States


GET 
/v2/b2c/locations/states/{country alpha2code or abbreviation}

OR

/v2/b2b/locations/states/{country alpha2code or abbreviation}



Sample Response:

[
    {
        "abbreviation": "AL",
        "name": "Alabama",
        "iso3166": "US-AL"
    },
    {
        "abbreviation": "AK",
        "name": "Alaska",
        "iso3166": "US-AK"
    },
    ...
   {
        "abbreviation": "WY",
        "name": "Wyoming",
        "iso3166": "US-WY"
    }
]