Skip to content
Markdown

States settings ​

Kanban board column configuration

INFO

Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.

POST /states-settings/create ​

Create a custom workflow state column for an organization and domain type.

Kerakli ruxsat: yo‘q — ruxsat e’lon qilgan ilova uchun yopiq · ruxsatlar qanday ishlaydi

So‘rov namunasi

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/states-settings/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "organization_id": "string",
  "name": "string",
  "type": "trades",
  "order": 0
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/states-settings/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "organization_id": "string",
    "name": "string",
    "type": "trades",
    "order": 0
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/states-settings/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "organization_id": "string",
        "name": "string",
        "type": "trades",
        "order": 0,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "organization_id": "string",
  "name": "string",
  "type": "trades",
  "order": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/states-settings/create');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

So‘rov tanasi

MaydonTurMajburiyTavsif
organization_idstringHaOrganization ObjectId this state column belongs to
namestringHaDisplay name of the state column
typestringHaThe domain this state column belongs to (STATE_TYPE). Mumkin qiymatlar: trades, saleOrders, deliveryOrders, purchases, purchaseOrders, purchaseRequests
ordernumberHaDisplay order within the same type; siblings are re-sequenced automatically
notestringYo‘qOptional descriptive note for the state column
bg_colorstringYo‘qBackground color hex code, e.g. #F1F2F4
json
{
  "organization_id": "string",
  "name": "string",
  "type": "trades",
  "order": 0,
  "note": "string",
  "bg_color": "string"
}

Javob

MaydonTurTavsif
_idstring
namestring
typestring
is_defaultboolean
default_keystring
organization_idstring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "name": "string",
    "type": "string",
    "is_default": false,
    "default_key": "string",
    "organization_id": "string"
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /states-settings/get-by-id/{id} ​

Fetch a single workflow state column by ObjectId.

Kerakli ruxsat: yo‘q — ruxsat e’lon qilgan ilova uchun yopiq · ruxsatlar qanday ishlaydi

So‘rov namunasi

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/states-settings/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/states-settings/get-by-id/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/states-settings/get-by-id/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/states-settings/get-by-id/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaState column ObjectId

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /states-settings/create.

POST /states-settings/get-paging ​

Flat sorted list of workflow state columns. Filterable by type, organization, and is_default. Returns a plain array sorted by {type, order} — not a {list, total} envelope.

Kerakli ruxsat: yo‘q — ruxsat e’lon qilgan ilova uchun yopiq · ruxsatlar qanday ishlaydi

So‘rov namunasi

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/states-settings/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "trades",
  "types": [
    "trades"
  ],
  "organization_id": "string",
  "is_default": false,
  "with_item_count": false
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/states-settings/get-paging', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "type": "trades",
    "types": [
      "trades"
    ],
    "organization_id": "string",
    "is_default": false,
    "with_item_count": false
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/states-settings/get-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "type": "trades",
        "types": [
            "trades",
        ],
        "organization_id": "string",
        "is_default": False,
        "with_item_count": False,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "type": "trades",
  "types": [
    "trades"
  ],
  "organization_id": "string",
  "is_default": false,
  "with_item_count": false
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/states-settings/get-paging');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

So‘rov tanasi

MaydonTurMajburiyTavsif
typestringYo‘qFilter by STATE_TYPE domain. Mumkin qiymatlar: trades, saleOrders, deliveryOrders, purchases, purchaseOrders, purchaseRequests
typesstring[]Yo‘qFilter by multiple STATE_TYPE values
organization_idstringYo‘qFilter by organization ObjectId
is_defaultbooleanYo‘qWhen true, return only default (system-seeded) columns; false returns custom ones only
with_item_countbooleanYo‘q
json
{
  "type": "trades",
  "types": [
    "trades"
  ],
  "organization_id": "string",
  "is_default": false,
  "with_item_count": false
}

Javob

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "_id": "string",
      "name": "string",
      "type": "string",
      "is_default": false,
      "default_key": "string",
      "organization_id": "string"
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}

PUT /states-settings/update/{id} ​

Update an existing workflow state column. Changing order re-sequences sibling columns of the same type. order is silently dropped for default (system-seeded) columns.

Kerakli ruxsat: yo‘q — ruxsat e’lon qilgan ilova uchun yopiq · ruxsatlar qanday ishlaydi

So‘rov namunasi

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/states-settings/update/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "order": 0,
  "note": "string",
  "bg_color": "string"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/states-settings/update/6712f0a9c4d1e87b3a0f9911', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string",
    "order": 0,
    "note": "string",
    "bg_color": "string"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/states-settings/update/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
        "order": 0,
        "note": "string",
        "bg_color": "string",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "string",
  "order": 0,
  "note": "string",
  "bg_color": "string"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/states-settings/update/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaState column ObjectId

So‘rov tanasi

MaydonTurMajburiyTavsif
namestringYo‘qNew display name
ordernumberYo‘qNew display order. Silently dropped for default columns.
notestringYo‘qUpdated note
bg_colorstringYo‘qUpdated background color hex code
json
{
  "name": "string",
  "order": 0,
  "note": "string",
  "bg_color": "string"
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /states-settings/create.

DELETE /states-settings/delete/{id} ​

Soft-delete a workflow state column (sets is_deleted=true). Guarded: default columns cannot be deleted, and columns still referenced by trade/sale-order/delivery-order documents are rejected with an error.

Kerakli ruxsat: yo‘q — ruxsat e’lon qilgan ilova uchun yopiq · ruxsatlar qanday ishlaydi

So‘rov namunasi

bash
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/states-settings/delete/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/states-settings/delete/6712f0a9c4d1e87b3a0f9911', {
  method: 'DELETE',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "DELETE",
    "https://api.bito.uz/integration-api/integration/api/v2/states-settings/delete/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/states-settings/delete/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaState column ObjectId

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

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

Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API