Region.getCountriesAndRegionsAndCities

Not Ready Implemented

This api method is in preperation und not ready implemented.

Request the Countries, Regions and Cities data from the shop system.

Request

JSON Example

[
  {
      "api":1,
      "method":"auth",
      "params":{
         "username":"...",
         "password":"..."
      },
      "id":1
   },
   {
    "api": 1,
    "method": "Region.getCountriesAndRegionsAndCities",
    "params": {},
    "id": 1
  }
]

Response

Response sends all Countries, Regions and Cities records:

[  
   {  
      "api":1,
      "result":[  
        {
        	"countryId": 15,
          "iso2Code": "AU",
          "iso3Code": "AUS",
          "name": "Australia",
          "regions": [
          	{
        			"regionId": 21,
							"code": "AU-QLD",
          		"name": "Queensland",
          		"sort": 5,
          		"status": "active",
          		"cities": [
            		{
            			"cityId": 8,
              		"name": "Brisbane"
            		},
                {
            			"cityId": 9,
              		"name": "Rockhampton"
            		}
          		]
   					}			
     			]
        },
        {
        	"countryId": 16,
          "iso2Code": "DE",
          "iso3Code": "DEU",
          "name": "Germany",
          "regions": [
          	{
        			"regionId": 80,
							"code": "DE-BY",
          		"name": "Bayern",
          		"sort": null,
          		"status": "active",
          		"cities": [
            		{
            			"cityId": 50,
              		"name": "München"
            		}
          		]
   					},
            {
        			"regionId": 81,
							"code": "DE-HE",
          		"name": "Hessen",
          		"sort": null,
          		"status": "active",
          		"cities": [
            		{
            			"cityId": 51,
              		"name": "Kassel"
            		}
          		]
   					}
     			]
        },
      ],
      "id":1
   }
]

As you can see in the JSON example the returned data stuctucture keeps on first level countries. Inside the countries there are **regions **and every region keeps the **citiies **inside.

Country Fields

Make sure values are properly encoded in the types specified below, as the Sync Agent client will not do any automatic conversion. Using strings instead of integers (eg.: "42" instead of 42), or integers instead of booleans (1 instead of true) will result in a validation error during sync.

Field name

Type

Mandatory

Value

Description

countryId

integer

yes

undefined

id of the country in the Shop system

iso2Code

varchar(2)

yes

undefined

iso3Code

varchar(3)

yes

name

varchar(255)

yes

undefined

name of the country

Region fields

Field Name

Type

Mandatory

Value

Description

regionId

integer

yes

undefined

id of the region in the shop system

code

varchar (32)

yes

undefined

unique short code of the region

name

varchar (255)

yes

undefined

name of the region

sort

integer

no

undefined

sort order

status

enum

yes

active, deleted

undefined

City Fields

Field Name

Type

Mandatory

Value

Description

cityId

integer

yes

undefined

id of the city in the shop system

name

varchar (128)

yes

undefined undefined