Skip to main content

Region

Create region#

Creates new region.

Request body:

AttributeTypeDescriptionNullable
externalIdStringRegion external idfalse
nameStringRegion namefalse
divisionIdStringDivision associated with the regionfalse
activeStringRegion availability for usersfalse
divisionExternalIdStringDivision external idfalse

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": 35,
"shopsCount": 0,
"active": true
}

Update region#

Update existing region by id.

Request body:

AttributeTypeDescriptionNullable
externalIdStringRegion external idfalse
nameStringRegion namefalse
divisionIdStringDivision associated with the regionfalse
activeStringRegion availability for usersfalse
divisionExternalIdStringDivision external idfalse

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 nametrue
shopIdsList of integersFind region by shopIdsfalse
divisionIdsList of integersFind regions by division idsfalse
activeBooleanGet only active regionsfalse
fieldsList of String (comma-separated)Add additional fields to response objectfalse
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
withDirsBooleanGet 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#

Return Region object

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,
"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
}
],
"divisionName": "Division 1",
"shopsCount": 8
}