Add

[POST] .../v1/region/add

Creates a new region. Use this method to add a new region node to the catalog before assigning that region to retail customers or delivery records. The method validates the required name, checks region add permission 445, inserts the region, writes an action log record, invalidates the region cache, sends the RegionAdded webhook and returns new_id. The request body is required, name must be provided and must not exceed 150 characters and parent_id may be 0 for a root region or a positive parent region id. Missing body, missing name, denied permission, database errors and other business failures are returned as HTTP 200 ErrorResult responses.

Request Parameters

Name Type Required Description
name String Required Region name.
parent_id Int64 Optional Parent region ID. Default value: 0.

Request Example

{
  "parent_id": 1,
  "name": "Tashkent"
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert Created record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": 12
  }
}