Country & Region
Spoonity supplies helper requests for returning a list of supported countries and regions.
Retrieve a list of countries
This request returns a list of all the countries this vendor serves. This is designed to be a helper request for form building.
Response attributes
- Name
country_id- Type
- integer
- Description
An internal reference number unique to each country.
- Name
code- Type
- string
- Description
The two letter ISO 3166-1 code associated with this country.
- Name
name- Type
- string
- Description
Indicates the country in a way that is more user friendly.
- Name
phone_code- Type
- string
- Description
This country's calling code.
- Name
zip_code- Type
- string
- Description
Used to validate a postal or zip code for this country.
- Name
phone_validate- Type
- string
- Description
Used to validate a phone number for this country.
- Name
flag_url- Type
- string
- Description
A url that links this country's flag.
Request
curl -G https://api.spoonity.com/countries
Response
[
{
"country_id": 1,
"code": "AF",
"name": "Afghanistan",
"phone_code": "93",
"zip_validate": null,
"phone_validate": null,
"flag_url": "https://s3.amazonaws.com/spoonity-flags/af.png"
},
{
"country_id": 2,
"code": "AL",
"name": "Albania",
"phone_code": "355",
"zip_validate": null,
"phone_validate": null,
"flag_url": "https://s3.amazonaws.com/spoonity-flags/al.png"
},
{
"country_id": 3,
"code": "DZ",
"name": "Algeria",
"phone_code": "213",
"zip_validate": null,
"phone_validate": null,
"flag_url": "https://s3.amazonaws.com/spoonity-flags/dz.png"
},
...
]
Retrieve a list of regions
This request returns a list of all the regions within a specific country this vendor serves. This is designed to be a helper request for form building.
Response attributes
- Name
region_id- Type
- integer
- Description
An internal reference number unique to each region.
- Name
code- Type
- string
- Description
The ISO 3166-2 subdivision code for this region.
- Name
name- Type
- string
- Description
Indicates the region in a way that is more user friendly.
Request
curl -G https://api.spoonity.com/countries/39/regions
Response
[
{
"region_id": 136,
"code": "AB",
"name": "Alberta"
},
{
"region_id": 137,
"code": "BC",
"name": "British Columbia"
},
{
"region_id": 138,
"code": "MB",
"name": "Manitoba"
},
{
"region_id": 139,
"code": "NB",
"name": "New Brunswick"
},
{
"region_id": 140,
"code": "NL",
"name": "Newfoundland and Labrador"
},
{
"region_id": 141,
"code": "NT",
"name": "Northwest Territories"
},
{
"region_id": 142,
"code": "NS",
"name": "Nova Scotia"
},
{
"region_id": 143,
"code": "NU",
"name": "Nunavut"
},
{
"region_id": 144,
"code": "ON",
"name": "Ontario"
},
{
"region_id": 145,
"code": "PE",
"name": "Prince Edward Island"
},
{
"region_id": 146,
"code": "QC",
"name": "Québec"
},
{
"region_id": 147,
"code": "SK",
"name": "Saskatchewan"
},
{
"region_id": 148,
"code": "YT",
"name": "Yukon Territory"
}
]