ReDoc documentation

directory/countries/{countryId}/regions

directory/countries/{countryId}/regions

Retrieve regions belonging to the given country, matching search criteria. $searchCriteria is optional; when omitted, all regions for the country are returned unfiltered.

Request
path Parameters
countryId
required
string

two-letter (ISO 3166-1 alpha-2) country id, e.g. "US"

query Parameters
searchCriteria[filterGroups][0][filters][0][field]
string

Field

searchCriteria[filterGroups][0][filters][0][value]
string

Value

searchCriteria[filterGroups][0][filters][0][conditionType]
string

Condition type

searchCriteria[sortOrders][0][field]
string

Sorting field.

searchCriteria[sortOrders][0][direction]
string

Sorting direction.

searchCriteria[pageSize]
integer

Page size.

searchCriteria[currentPage]
integer

Current page.

Responses
200

200 Success.

401

401 Unauthorized

default

Unexpected error

get/V1/directory/countries/{countryId}/regions
Response samples
{
  • "items": [
    ],
  • "search_criteria": {
    },
  • "total_count": 0
}

directory/countries/{countryId}/regions

Create one or more regions under the given country in a single atomic operation. All-or-nothing: the whole payload is validated before anything is written, and every region is persisted in one transaction, so a failure anywhere leaves no rows behind. Validation failures are reported together in one InputException, each naming the offending payload position (e.g. regions[3].code). Region codes must be unique within the country and within the payload. The number of regions accepted per call is capped.

Request
path Parameters
countryId
required
string

two-letter (ISO 3166-1 alpha-2) country id, e.g. "US"

Request Body schema:
required
Array of objects (directory-region-rest-api-data-region-create-request-interface)
Responses
200

200 Success.

401

401 Unauthorized

500

Internal Server error

default

Unexpected error

post/V1/directory/countries/{countryId}/regions
Request samples
{
  • "regions": [
    ]
}
Response samples
[
  • {
    }
]