Add

[POST] .../v1/department/add

Creates a new department. Use this method to create an item department before assigning catalog items to that department. It returns new_id and validates that name is provided and does not exceed 50 characters before creating the department. The caller must have department add permission; missing body, invalid name, denied access, duplicate validation failures and storage errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
name String Required Department name.

Request Example

{
  "name": "Shoes"
}

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": 5
  }
}