Skip to main content

Region

Create region#

Creates a new region.

Request body:

AttributeTypeDescriptionNullable
externalIdStringRegion external idtrue
nameStringRegion namefalse
divisionIdIntegerIdentifier of the division the region belongs tofalse
activeBooleanWhether the region is activefalse
divisionExternalIdStringExternal id of the division the region belongs to, alternative to divisionIdtrue

Response

Returns Region object

Examples

curl --request POST https://api.qvalon.com/v1/orgstruct/regions \
--header 'Authorization: Bearer <your_token>' \
--header 'Content-Type: application/json' \
-d '{"name":"Test region","divisionId":28,"active":true}'
200 OK
{
"id": 66,
"name": "Test region",
"divisionId": 28,
"shopsCount": 0,
"active": true
}

Update region#

Updates an existing region by id.

Request body:

AttributeTypeDescriptionNullable
externalIdStringRegion external idtrue
nameStringRegion namefalse
divisionIdIntegerIdentifier of the division the region belongs totrue
activeBooleanWhether the region is activefalse
divisionExternalIdStringExternal id of the division the region belongs to, alternative to divisionIdtrue

Response

Returns Region object

Examples

curl --request PUT https://api.qvalon.com/v1/orgstruct/regions/66 \
--header 'Authorization: Bearer <your_token>' \
--header 'Content-Type: application/json' \
-d '{"name":"Test region update","divisionId":28,"active":true}'
200 OK
{
"id": 66,
"name": "Test region update",
"divisionId": 28,
"active": true,
"shopsCount": 0
}

List regions#

Returns a list of Region objects
Available fields to add in object see here

Request parameters:

Request ParameterTypeDescriptionRequired
idsList of integersFilter regions by specified ids (comma-separated)false
nameLikeStringFind regions by namefalse
shopIdsList of integersFind regions by shop idsfalse
divisionIdsList of integersFind regions by division idsfalse
businessDirIdsList of integersFind regions by business direction idsfalse
activeBooleanGet only active regionsfalse
fieldsList of String (comma-separated)Additional region fields to include in the response object. Available values: dirs, division, shops. Default: dirs, divisionfalse
userIdIntegerFind regions by user Idfalse
businessDirIdIntegerFind regions by businessDir Idfalse
shopIdIntegerFind regions by shop Idfalse
searchStringStringFind regions by name or division name or manager of regions first or last namefalse
withDirsBooleanDeprecated, use fields=dirs instead. Get regions where appointed are managerfalse

Examples

curl https://api.qvalon.com/v1/orgstruct/regions \
--header 'Authorization: Bearer <your_token>'
200 OK
[
{
"id": 66,
"name": "Test region",
"divisionId": 28,
"active": true,
"divisionName": "Division 1",
"shopsCount": 8,
"division": {
"id": 28,
"name": "Division 1",
"active": true,
"regionsCount": 6,
"shopsCount": 51
},
"dirs": [
{
"id": 1697,
"active": true,
"login": "samplemail@example.com",
"firstName": "Elena",
"lastName": "Savina",
"position": "Region manager",
"level": "REGION",
"businessDirId": 1001,
"lang": "en_EN",
"invited": false
}
]
}
]

Get region by id#

Returns a Region object. Unlike List regions, this endpoint doesn't accept a fields parameter โ€” the relations (dirs, division, shops) are never included.

Examples

curl https://api.qvalon.com/v1/orgstruct/regions/66 \
--header 'Authorization: Bearer <your_token>'
200 OK
{
"id": 66,
"name": "Test region",
"divisionId": 28,
"active": true,
"shopsCount": 8
}