Skip to content

Category ​

INFO

Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.

POST /category/create ​

This method allows adding category into the account.

Request body

FieldTypeRequiredDescription
namestringYes
typestringNotype categories. One of: product, material, semi_product
parent_idstringNoid of parent category
is_available_for_salebooleanYesis available for sale. Default: true
organization_idsstring[]Yesids of organization
imagestringNoimage path of category that uploaded to the server
json
{
  "name": "string",
  "type": "product",
  "parent_id": "string",
  "is_available_for_sale": true,
  "organization_ids": [
    "string"
  ],
  "image": "string"
}

Response

FieldTypeDescription
_idstringid of category
namestring
is_main_materialboolean
is_available_for_saleboolean
typestring
parent_idstringid of parent category
organization_idsstring[]ids of organizations
child_coundnumber
item_countnumbercount off all child
countnumber
imagestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "name": "string",
    "is_main_material": false,
    "is_available_for_sale": false,
    "type": "string",
    "parent_id": "string",
    "organization_ids": [
      "string"
    ],
    "child_cound": 0,
    "item_count": 0,
    "count": 0,
    "image": "string"
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /category/update ​

This method allows updating category in the account.

Request body

FieldTypeRequiredDescription
namestringYes
typestringNotype categories. One of: product, material, semi_product
parent_idstringNoid of parent category
is_available_for_salebooleanYesis available for sale. Default: true
organization_idsstring[]Yesids of organization
imagestringNoimage path of category that uploaded to the server
_idstringYesid of category
json
{
  "name": "string",
  "type": "product",
  "parent_id": "string",
  "is_available_for_sale": true,
  "organization_ids": [
    "string"
  ],
  "image": "string",
  "_id": "string"
}

Response

Same response shape as POST /category/create.

DELETE /category/delete/{id} ​

Delete a category

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "ok",
  "time": "2025-05-01T12:00:00Z"
}

GET /category/get-by-id/{id} ​

Get category using its _id

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

Same response shape as POST /category/create.

POST /category/get-paging ​

Get categories by paging

Request body

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
searchstringNo
topbooleanNo
updated_atstring (date-time)No
organization_idstringNo
parent_idstringNo
json
{
  "page": 1,
  "limit": 20,
  "search": "string",
  "top": false,
  "updated_at": "2023-10-01T12:00:00Z",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d800",
  "parent_id": "63f8b0c4e4b0d3a2f8e4b0c4"
}

Response

data.total is the total number of records and data.data[] holds the current page. The table below describes one record.

FieldTypeDescription
_idstringid of category
namestring
is_main_materialboolean
is_available_for_saleboolean
typestring
parent_idstringid of parent category
organization_idsstring[]ids of organizations
child_coundnumber
item_countnumbercount off all child
countnumber
imagestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "string",
        "name": "string",
        "is_main_material": false,
        "is_available_for_sale": false,
        "type": "string",
        "parent_id": "string",
        "organization_ids": [
          "string"
        ],
        "child_cound": 0,
        "item_count": 0,
        "count": 0,
        "image": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /category/get-deleted ​

Get deleted category ids

Query parameters

ParameterTypeRequiredDescription
deleted_atstringYes

Request body

No request body.

Response

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    "string"
  ],
  "time": "2025-05-01T12:00:00Z"
}

GET /category/get-by-name ​

Get a category by its exact name.

Query parameters

ParameterTypeRequiredDescription
namestringYes

Request body

No request body.

Response

Same response shape as POST /category/create.


This page is generated from the OpenAPI spec.

Bito 2.0 Integration API