Documentation / API / Operations on States

GET and COUNT operations available on states.

States Operations

GET

URL

POST https://your-secured-store-url:443/api/v1/geo/states/get

Filters

Filter Type
id Array of GUID
countryid Array of GUID (Countries)
code Array of String (max 255 chars)
name Array of String (max 255 chars)

Request

Retrieve all the items (max 1000)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        }
    }

Retrieve specific items by ID

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
            'id' : ['05e58b5c-d043-4a38-a16e-7957336047d0','18aaa336-ff76-49a0-bd28-124d07d1602a']
        }
    }

Most complete request (just to give you the format of each parameter)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
		    'id' : ['05e58b5c-d043-4a38-a16e-7957336047d0','18aaa336-ff76-49a0-bd28-124d07d1602a'],
		    'countryid' : ['4e713edd-a030-433c-86ce-fbeb9af7e6c7','75b36fa9-4eb5-4a2f-8bd2-2baafd81cfe9'],
		    'code' : ['AK','NB'],
		    'name' : ['Alaska','New Brunswick']
	    },
        'pagination' : {
            'pageNumber' : '1',
            'pageSize' : '1000'
        }
    }

Response

If no error occured, you will receive a response like this one (object type: State). Please refer to error messages to learn more about the possible error responses.

[
   {
      "id": "05e58b5c-d043-4a38-a16e-7957336047d0",
      "countryid": "4e713edd-a030-433c-86ce-fbeb9af7e6c7",
      "countrycode": "US",
      "countryname": "United States",
      "code": "AK",
      "name": "Alaska"
   },
   {
      "id": "18aaa336-ff76-49a0-bd28-124d07d1602a",
      "countryid": "75b36fa9-4eb5-4a2f-8bd2-2baafd81cfe9",
      "countrycode": "CA",
      "countryname": "Canada",
      "code": "NB",
      "name": "New Brunswick"
   }
]

COUNT

URL

POST https://your-secured-store-url:443/api/v1/geo/states/count

Filters

Filter Type
id Array of GUID
countryid Array of GUID (Countries)
code Array of String (max 255 chars)
name Array of String (max 255 chars)

Request

Count the items

{
    'authentication' : {
        'apiKey' : 'jjns7519v1v3ns6xU162'
    }
}

Count specific items by country id

{
    'authentication' : {
        'apiKey' : 'jjns7519v1v3ns6xU162'
    },
    'filters' : {
        'countryid' : ['4e713edd-a030-433c-86ce-fbeb9af7e6c7']
    }
}

Most complete request (just to give you the format of each parameter)

{
    'authentication' : {
        'apiKey' : 'jjns7519v1v3ns6xU162'
    },
    'filters' : {
		'id' : ['05e58b5c-d043-4a38-a16e-7957336047d0','18aaa336-ff76-49a0-bd28-124d07d1602a'],
		'countryid' : ['4e713edd-a030-433c-86ce-fbeb9af7e6c7','75b36fa9-4eb5-4a2f-8bd2-2baafd81cfe9'],
		'code' : ['AK','NB'],
		'name' : ['Alaska','New Brunswick']
	}
}

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

{
   "count": "40"
}