Skip to content
View as Markdown

Sale order ​

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 /sale-order/create ​

Create a sale order. The server assigns uuid (A<number>); a uuid sent in the body is ignored. A repeated request creates a second order.

Required permission: sale_order_create · how permissions work

Example request

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

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/sale-order/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "organization_id": "67b486d242ed76693cd2cc59",
        "customer_id": "67b486d242ed76693cd2cc59",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "organization_id": "67b486d242ed76693cd2cc59",
  "customer_id": "67b486d242ed76693cd2cc59"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sale-order/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);

Request body

FieldTypeRequiredDescription
codestringNo
namestringNo
organization_idstringYes
visit_idstringNo
customer_idstringYes
customer_assistant_idstringNo
responsible_idstringNo
currency_idstringNo
currencyobjectNo
currency._idstring (objectId)Yes
currency.numeratornumberYes
currency.denominatornumberYes
currency.valuenumberYes
currency.precisionnumberNo
currency.round_typestringNoOne of: floor, ceil, round
statestringNoOne of: new, draft, in_progress, canceled, done, accepted
state_idstringNo
datestringNo
delivery_datestringNo
notestringNoComplete order note. Integration creates preserve long courier, pickup, and customer instructions; the API request-body limit still applies.
discountsobject[]No
discounts[]._idstring (objectId)Yes
discounts[].valuenumberYes
discounts[].namestringYes
discounts[].apply_typestringYesOne of: percent, cash
discounts[].is_custombooleanYes
productsobject[]No
products[].product_idstring (objectId)Yes
products[].amountnumberYes
products[].pricenumberYes
products[].real_pricenumberNo
products[].discountsobject[]No
products[].discounts[]._idstring (objectId)Yes
products[].discounts[].valuenumberYes
products[].discounts[].namestringYes
products[].discounts[].apply_typestringYesOne of: percent, cash
products[].discounts[].is_custombooleanYes
products[].price_idstring (objectId)No
products[].warehouse_idstring (objectId)No
products[].box_countnumberNo
products[].box_itemnumberNo
products[].tax_idsstring[]No
products[].taxesobject[]No
products[].taxes[]._idstringYes
products[].taxes[].namestringYes
products[].taxes[].ratenumberYes
products[].taxes[].typestringYesOne of: included, added
products[].taxes[].to_pricebooleanYes
products[].taxes[].is_manualbooleanYes
products[].total_to_paynumberNo
products[].notestringNo
products[].extra_costsobject[]No
products[].extra_costs[].cost_idstringYes
products[].extra_costs[].amountnumberYes
products[].extra_costs[].indexnumberNo
products[].used_measureobjectNo
products[].used_measure._idstringYes
products[].used_measure.rationumberYes
products[].used_measure.amountnumberYes
delivery_addressobjectNo
delivery_address.longnumberNo
delivery_address.latnumberNo
delivery_address.human_addressobjectNo
delivery_address.human_address.citystringNo
delivery_address.human_address.statestringNo
delivery_address.human_address.zipstringNo
delivery_address.human_address.addressstringNo
delivery_address.bearingnumberNo
price_idstringNo
custom_fieldsobjectNo
custom_fields._idstringYes
custom_fields.valueobjectNo
calc_tax_after_discountbooleanNo
additional_costsobject[]No
additional_costs[].cost_idstringYes
additional_costs[].amountnumberYes
additional_costs[].customer_idstringNo
additional_costs[].employee_idstringNo
additional_costs[].supplier_idstringNo
additional_costs[].person_idstringNo
json
{
  "code": "string",
  "name": "string",
  "organization_id": "67b486d242ed76693cd2cc59",
  "visit_id": "67b486d242ed76693cd2cc59",
  "customer_id": "67b486d242ed76693cd2cc59",
  "customer_assistant_id": "67b486d242ed76693cd2cc59",
  "responsible_id": "67b486d242ed76693cd2cc59",
  "currency_id": "67b486d242ed76693cd2cc59",
  "currency": {
    "_id": "66126f4b1e2f4a9cb4244c8f",
    "numerator": 1,
    "denominator": 1000,
    "value": 11000,
    "precision": 3,
    "round_type": "floor"
  },
  "state": "new",
  "state_id": "67b486d242ed76693cd2cc59",
  "date": "2023-10-01T12:00:00Z",
  "delivery_date": "2023-10-01T12:00:00Z",
  "note": "string",
  "discounts": [
    {
      "_id": "66126f4b1e2f4a9cb4244c90",
      "value": 10,
      "name": "10%",
      "apply_type": "percent",
      "is_custom": true
    }
  ],
  "products": [
    {
      "product_id": "66126f4b1e2f4a9cb4244a01",
      "amount": 2,
      "price": 15000,
      "real_price": 14500,
      "discounts": [],
      "price_id": "66126f4b1e2f4a9cb4244a02",
      "warehouse_id": "66126f4b1e2f4a9cb4244a03",
      "box_count": 2,
      "box_item": 24,
      "tax_ids": [],
      "taxes": [],
      "total_to_pay": 0,
      "note": "string",
      "extra_costs": [],
      "used_measure": {
        "_id": null,
        "ratio": null,
        "amount": null
      }
    }
  ],
  "delivery_address": {
    "long": 0,
    "lat": 0,
    "human_address": {
      "city": "string",
      "state": "string",
      "zip": "string",
      "address": "string"
    },
    "bearing": 0
  },
  "price_id": "2023-10-01T12:00:00Z",
  "custom_fields": {
    "_id": "67b486d242ed76693cd2cc59",
    "value": {}
  },
  "calc_tax_after_discount": false,
  "additional_costs": [
    {
      "cost_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "amount": 0,
      "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "employee_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "person_id": "64b7f4d9e2b3b6a0b7c5d7ff"
    }
  ]
}

Response

FieldTypeDescription
_idstring
created_atstring
updated_atstring
namestring
uuidstring
visit_idstring
codestring
organization_idstring
organizationobject
organization._idstring
organization.namestring
customer_idstring
customerobject
customer._idstring
customer.typestringOne of: legal, natural
customer.phone_numberstring
customer.phone_numbersstring[]
customer.namestring
customer.imagestring
customer.custom_fieldsobject[]
customer.custom_fields[]._idstring
customer.custom_fields[].valueobject
customer_assistantobject
customer_assistant._idstring
customer_assistant.namestring
customer_assistant.typestringOne of: legal, natural
customer_assistant_hierarchyobject[]
customer_assistant_hierarchy[]._idstring
customer_assistant_hierarchy[].namestring
customer_assistant_hierarchy[].typestringOne of: legal, natural
customer_assistant_hierarchy[].first_namestring
customer_assistant_hierarchy[].last_namestring
customer_assistant_hierarchy[].middle_namestring
responsible_idstring
customer_image_urlstring
responsibleobject
responsible._idstring
responsible.full_namestring
price_idstring
priceobject
price._idstring
price.namestring
price.short_namestring
price.codestring
state_idstring
statestringOne of: new, draw, in_progress, canceled, done, accepted
notestring
datestring
delivery_datestring
numberstring
deviceobject
device._idstring
device.namestring
device.device_idstring
currencyobject
currency._idstring (objectId)
currency.to_currency_idstring (objectId)
currency.uuidnumber
currency.namestring
currency.valuenumber
currency.symbolstring
currency.sidestringOne of: start, end
currency.numeratornumber
currency.denominatornumber
currency.round_typestringOne of: floor, ceil, round
currency.precisionnumber
currency_idstring
total_to_paynumber
total_pricenumber
discountnumber
total_discountnumber
discountsobject[]
discounts[]._idstring
discounts[].namestring
discounts[].valuenumber
discounts[].apply_typestringOne of: percent, cash
discounts[].currency_idstring
productsobject[]
delivery_addressobject
delivery_address.longnumber
delivery_address.latnumber
delivery_address.human_addressobject
delivery_address.human_address.addresstring
delivery_address.human_address.citystring
delivery_address.human_address.statestring
delivery_address.human_address.zipstring
total_salenumber
total_amountnumber
trade_statusstringOne of: zero, partial, fully
tradesobject[]
trades[]._idstring
trades[].typestringOne of: b2b, b2c
trades[].organization_idstring
trades[].statestringOne of: new, in_progress, draft, canceled, done
trades[].state_idstring
trades[].numberstring
trades[].uuidnumber
trades[].currencyobject
trades[].currency._idstring
trades[].currency.to_currency_idstring
trades[].currency.namestring
trades[].currency.valuenumber
trades[].currency.numeratornumber
trades[].currency.denominatornumber
trades[].currency.round_typestringOne of: floor, ceil, round
trades[].currency.precisionnumber
trades[].cashbox_idstring
trades[].calc_tax_after_discountboolean
trades[].sale_settingsobject
trades[].sale_settings.discountnumber
trades[].total_extra_costnumber
trades[].total_effected_extra_costnumber
custom_fieldsobject[]
custom_fields[]._idstring
custom_fields[].valuestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "created_at": "string",
    "updated_at": "string",
    "name": "string",
    "uuid": "A1024",
    "visit_id": "67b486d242ed76693cd2cc59",
    "code": "67b486d242ed76693cd2cc59",
    "organization_id": "67b486d242ed76693cd2cc59",
    "organization": {
      "_id": "string",
      "name": "string"
    },
    "customer_id": "67b486d242ed76693cd2cc59",
    "customer": {
      "_id": "string",
      "type": "legal",
      "phone_number": "string",
      "phone_numbers": [
        "string"
      ],
      "name": "string",
      "image": "string",
      "custom_fields": [
        {
          "_id": null,
          "value": null
        }
      ]
    },
    "customer_assistant": {
      "_id": "string",
      "name": "string",
      "type": "legal"
    },
    "customer_assistant_hierarchy": [
      {
        "_id": "string",
        "name": "string",
        "type": "legal",
        "first_name": "string",
        "last_name": "string",
        "middle_name": "string"
      }
    ],
    "responsible_id": "string",
    "customer_image_url": "string",
    "responsible": {
      "_id": "string",
      "full_name": "string"
    },
    "price_id": "string",
    "price": {
      "_id": "string",
      "name": "string",
      "short_name": "string",
      "code": "string"
    },
    "state_id": "string",
    "state": "new",
    "note": "string",
    "date": "string",
    "delivery_date": "string",
    "number": "string",
    "device": {
      "_id": "string",
      "name": "string",
      "device_id": "string"
    },
    "currency": {
      "_id": "66126f4b1e2f4a9cb4244c8b",
      "to_currency_id": "66126f4b1e2f4a9cb4244c8c",
      "uuid": "66126f4b1e2f4a9cb4244c8d",
      "name": "string",
      "value": 1,
      "symbol": "string",
      "side": "start",
      "numerator": 1,
      "denominator": 1,
      "round_type": "floor",
      "precision": 3
    },
    "currency_id": "string",
    "total_to_pay": 0,
    "total_price": 0,
    "discount": 0,
    "total_discount": 0,
    "discounts": [
      {
        "_id": "string",
        "name": "string",
        "value": 0,
        "apply_type": "percent",
        "currency_id": "string"
      }
    ],
    "products": [
      {}
    ],
    "delivery_address": {
      "long": 0,
      "lat": 0,
      "human_address": {
        "addres": "string",
        "city": "string",
        "state": "string",
        "zip": "string"
      }
    },
    "total_sale": 0,
    "total_amount": 0,
    "trade_status": "zero",
    "trades": [
      {
        "_id": "string",
        "type": "b2b",
        "organization_id": "string",
        "state": "new",
        "state_id": "string",
        "number": "string",
        "uuid": 0,
        "currency": {
          "_id": null,
          "to_currency_id": null,
          "name": null,
          "value": null,
          "numerator": null,
          "denominator": null,
          "round_type": null,
          "precision": null
        },
        "cashbox_id": "string",
        "calc_tax_after_discount": false,
        "sale_settings": {
          "discount": null
        },
        "total_extra_cost": 0,
        "total_effected_extra_cost": 0
      }
    ],
    "custom_fields": [
      {
        "_id": "string",
        "value": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /sale-order/update ​

This method allows updating saler-order in the account.

Required permission: sale_order_update · how permissions work

Example request

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/sale-order/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "_id": "67b486d242ed76693cd2cc59",
  "responsible_id": "67b486d242ed76693cd2cc59"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sale-order/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "_id": "67b486d242ed76693cd2cc59",
    "responsible_id": "67b486d242ed76693cd2cc59"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/sale-order/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "_id": "67b486d242ed76693cd2cc59",
        "responsible_id": "67b486d242ed76693cd2cc59",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "_id": "67b486d242ed76693cd2cc59",
  "responsible_id": "67b486d242ed76693cd2cc59"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sale-order/update');
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);

Request body

FieldTypeRequiredDescription
_idstringYes
codestringNo
namestringNo
organization_idstringNo
visit_idstringNo
customer_idstringNo
customer_assistant_idstringNo
responsible_idstringYes
currency_idstringNo
currencyobjectNo
currency._idstring (objectId)Yes
currency.numeratornumberYes
currency.denominatornumberYes
currency.valuenumberYes
datestringNo
delivery_datestringNo
notestringNo
discountsobject[]No
discounts[]._idstring (objectId)Yes
discounts[].valuenumberYes
discounts[].namestringYes
discounts[].is_custombooleanYes
discounts[].apply_typestringYesOne of: percent, cash
productsobject[]No
products[].product_idstring (objectId)Yes
products[].amountnumberYes
products[].pricenumberYes
products[].real_pricenumberNo
products[].discountsobject[]No
products[].discounts[]._idstring (objectId)Yes
products[].discounts[].valuenumberYes
products[].discounts[].namestringYes
products[].discounts[].is_custombooleanYes
products[].discounts[].apply_typestringYesOne of: percent, cash
products[].price_idstring (objectId)No
products[].warehouse_idstring (objectId)No
products[].box_countnumberNo
products[].box_itemnumberNo
products[].tax_idsstring[]No
products[].taxesobject[]No
products[].taxes[]._idstringYes
products[].taxes[].namestringYes
products[].taxes[].ratenumberYes
products[].taxes[].typestringYesOne of: included, added
products[].taxes[].to_pricebooleanYes
products[].taxes[].is_manualbooleanYes
products[].total_to_paynumberNo
products[].notestringNo
products[].extra_costsobject[]No
products[].extra_costs[].cost_idstringYes
products[].extra_costs[].amountnumberYes
products[].extra_costs[].indexnumberNo
products[].used_measureobjectNo
products[].used_measure._idstringYes
products[].used_measure.rationumberYes
products[].used_measure.amountnumberYes
delivery_addressobjectNo
delivery_address.longnumberNo
delivery_address.latnumberNo
delivery_address.human_addressobjectNo
delivery_address.human_address.citystringNo
delivery_address.human_address.statestringNo
delivery_address.human_address.zipstringNo
delivery_address.human_address.addressstringNo
delivery_address.bearingnumberNo
price_idstringNo
custom_fieldsobjectNo
custom_fields._idstringYes
custom_fields.valuestringNomust be any data types
customerobjectNo
customer.namestringNo
customer.phone_numberstringNo
customer.phone_numbersstring[]No
customer.custom_fieldsobject[]NoCustom-field values.
customer.custom_fields[]._idstringYes
customer.custom_fields[].valueanyNoField value; its type depends on the custom field.
customer._idstringYes
calc_tax_after_discountbooleanNo
additional_costsobject[]No
additional_costs[].cost_idstringYes
additional_costs[].amountnumberYes
additional_costs[].customer_idstringNo
additional_costs[].employee_idstringNo
additional_costs[].supplier_idstringNo
additional_costs[].person_idstringNo
json
{
  "_id": "67b486d242ed76693cd2cc59",
  "code": "",
  "name": "",
  "organization_id": "67b486d242ed76693cd2cc59",
  "visit_id": "67b486d242ed76693cd2cc59",
  "customer_id": "67b486d242ed76693cd2cc59",
  "customer_assistant_id": "67b486d242ed76693cd2cc59",
  "responsible_id": "67b486d242ed76693cd2cc59",
  "currency_id": "67b486d242ed76693cd2cc59",
  "currency": {
    "_id": "66126f4b1e2f4a9cb4244c8f",
    "numerator": 1,
    "denominator": 1000,
    "value": 11000
  },
  "date": "2023-10-01T12:00:00Z",
  "delivery_date": "2023-10-01T12:00:00Z",
  "note": "string",
  "discounts": [
    {
      "_id": "66126f4b1e2f4a9cb4244c90",
      "value": 10,
      "name": "10%",
      "is_custom": false,
      "apply_type": "percent"
    }
  ],
  "products": [
    {
      "product_id": "66126f4b1e2f4a9cb4244a01",
      "amount": 2,
      "price": 15000,
      "real_price": 14500,
      "discounts": [],
      "price_id": "66126f4b1e2f4a9cb4244a02",
      "warehouse_id": "66126f4b1e2f4a9cb4244a03",
      "box_count": 2,
      "box_item": 24,
      "tax_ids": [],
      "taxes": [],
      "total_to_pay": 0,
      "note": "string",
      "extra_costs": [],
      "used_measure": {
        "_id": null,
        "ratio": null,
        "amount": null
      }
    }
  ],
  "delivery_address": {
    "long": 0,
    "lat": 0,
    "human_address": {
      "city": "string",
      "state": "string",
      "zip": "string",
      "address": "string"
    },
    "bearing": 0
  },
  "price_id": "2023-10-01T12:00:00Z",
  "custom_fields": {
    "_id": "67b486d242ed76693cd2cc59",
    "value": "any"
  },
  "customer": {
    "name": "string",
    "phone_number": "string",
    "phone_numbers": [
      "string"
    ],
    "custom_fields": [
      {
        "_id": null,
        "value": null
      }
    ],
    "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  },
  "calc_tax_after_discount": false,
  "additional_costs": [
    {
      "cost_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "amount": 0,
      "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "employee_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "person_id": "64b7f4d9e2b3b6a0b7c5d7ff"
    }
  ]
}

Response

Same response shape as POST /sale-order/create.

DELETE /sale-order/delete/{id} ​

Delete a sale-order

Required permission: sale_order_delete · how permissions work

Example request

bash
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/sale-order/delete/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sale-order/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/sale-order/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/sale-order/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);

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 /sale-order/get-by-id/{id} ​

Get sale-order using its _id

Required permission: sale_order · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sale-order/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/sale-order/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/sale-order/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);

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

Same response shape as POST /sale-order/create.

POST /sale-order/get-paging ​

Get sale-orders by paging

Required permission: sale_order · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-paging', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 1,
    "limit": 20
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sale-order/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);

Request body

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
organization_idstringNo
customer_idstringNo
currency_idstringNo
statesstring[]No
searchstringNo
date_fromstringNo
date_tostringNo
delivery_date_fromstringNo
delivery_date_tostringNo
created_from_botbooleanNo
trade_statusesstring[]No
visit_idstringNo
state_idstringNo
namestringNo
json
{
  "page": 1,
  "limit": 20,
  "organization_id": "67b486d242ed76693cd2cc59",
  "customer_id": "67b486d242ed76693cd2cc59",
  "currency_id": "67b486d242ed76693cd2cc59",
  "states": [
    "string"
  ],
  "search": "string",
  "date_from": "2023-10-01T12:00:00Z",
  "date_to": "2023-10-01T12:00:00Z",
  "delivery_date_from": "2023-10-01T12:00:00Z",
  "delivery_date_to": "2023-10-01T12:00:00Z",
  "created_from_bot": false,
  "trade_statuses": [
    "string"
  ],
  "visit_id": "67b486d242ed76693cd2cc59",
  "state_id": "67b486d242ed76693cd2cc59",
  "name": "string"
}

Response

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

FieldTypeDescription
created_atstring
updated_atstring
namestring
uuidstring
codestring
organizationobject
organization._idstring
organization.namestring
customerobject
customer._idstring
customer.typestringOne of: legal, natural
customer.phone_numberstring
customer.phone_numbersstring[]
customer.namestring
customer.imagestring
customer.custom_fieldsobject[]
customer.custom_fields[]._idstring
customer.custom_fields[].valueobject
customer_image_urlstring
responsibleobject
responsible._idstring
responsible.full_namestring
state_idstring
statestringOne of: new, draw, in_progress, canceled, done, accepted
notestring
datestring
numberstring
currency_idstring
total_to_paynumber
total_pricenumber
total_discountnumber
total_salenumber
total_amountnumber
trade_statusstringOne of: zero, partial, fully
created_from_botboolean
positionnumber
taskobject
task.type_idstring
task.datestring
task.created_bystring
task.responsible_idstring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "created_at": "string",
        "updated_at": "string",
        "name": "string",
        "uuid": "A1024",
        "code": "string",
        "organization": {
          "_id": "string",
          "name": "string"
        },
        "customer": {
          "_id": "string",
          "type": "legal",
          "phone_number": "string",
          "phone_numbers": [
            "string"
          ],
          "name": "string",
          "image": "string",
          "custom_fields": [
            {
              "_id": null,
              "value": null
            }
          ]
        },
        "customer_image_url": "string",
        "responsible": {
          "_id": "string",
          "full_name": "string"
        },
        "state_id": "67b486d242ed76693cd2cc59",
        "state": "new",
        "note": "string",
        "date": "string",
        "number": "string",
        "currency_id": "string",
        "total_to_pay": 0,
        "total_price": 0,
        "total_discount": 0,
        "total_sale": 0,
        "total_amount": 0,
        "trade_status": "zero",
        "created_from_bot": false,
        "position": 0,
        "task": {
          "type_id": "67b486d242ed76693cd2cc59",
          "date": "2023-10-01T12:00:00Z",
          "created_by": "67b486d242ed76693cd2cc59",
          "responsible_id": "67b486d242ed76693cd2cc59"
        }
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /sale-order/get-deleted ​

Get deleted sale-order ids

Required permission: sale_order · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-deleted?deleted_at=DELETED_AT' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-deleted?deleted_at=DELETED_AT', {
  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/sale-order/get-deleted?deleted_at=DELETED_AT",
    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/sale-order/get-deleted?deleted_at=DELETED_AT');
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);

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

PUT /sale-order/accept/{id} ​

Accept a sale order: move it into the first work column.

Required permission: sale_order_update · how permissions work

Example request

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

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/sale-order/accept/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/sale-order/accept/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

Same response shape as POST /sale-order/create.

POST /sale-order/get-by-customer/for-bot ​

List sale orders for a given customer, formatted for bot/external consumption.

Required permission: sale_order · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-by-customer/for-bot' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-by-customer/for-bot', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 1,
    "limit": 20
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-by-customer/for-bot",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-by-customer/for-bot');
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);

Request body

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
customer_idstringNo
statesstring[]No
organization_idstringNoOrganization ObjectId.
nameanyNo
visit_idstringNo
currency_idstringNo
created_from_botbooleanNo
date_fromstring (date-time)NoStart of the date range.
date_tostring (date-time)NoEnd of the date range.
delivery_date_fromstring (date-time)No
delivery_date_tostring (date-time)No
trade_statusesstring[]No
state_idstringNo
json
{
  "page": 1,
  "limit": 20,
  "customer_id": "string",
  "states": [
    "new"
  ],
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "name": null,
  "visit_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "created_from_bot": false,
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "delivery_date_from": "2025-05-01T12:00:00Z",
  "delivery_date_to": "2025-05-01T12:00:00Z",
  "trade_statuses": [
    "zero"
  ],
  "state_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}

Response

FieldTypeDescription
listobject[]
list[]._idstring
list[].created_atstring
list[].updated_atstring
list[].namestring
list[].uuidstring
list[].visit_idstring
list[].codestring
list[].organization_idstring
list[].organizationobject
list[].organization._idstring
list[].organization.namestring
list[].customer_idstring
list[].customerobject
list[].customer._idstring
list[].customer.typestringOne of: legal, natural
list[].customer.phone_numberstring
list[].customer.phone_numbersstring[]
list[].customer.namestring
list[].customer.imagestring
list[].customer.custom_fieldsobject[]
list[].customer_assistantobject
list[].customer_assistant._idstring
list[].customer_assistant.namestring
list[].customer_assistant.typestringOne of: legal, natural
list[].customer_assistant_hierarchyobject[]
list[].customer_assistant_hierarchy[]._idstring
list[].customer_assistant_hierarchy[].namestring
list[].customer_assistant_hierarchy[].typestringOne of: legal, natural
list[].customer_assistant_hierarchy[].first_namestring
list[].customer_assistant_hierarchy[].last_namestring
list[].customer_assistant_hierarchy[].middle_namestring
list[].responsible_idstring
list[].customer_image_urlstring
list[].responsibleobject
list[].responsible._idstring
list[].responsible.full_namestring
list[].price_idstring
list[].priceobject
list[].price._idstring
list[].price.namestring
list[].price.short_namestring
list[].price.codestring
list[].state_idstring
list[].statestringOne of: new, draw, in_progress, canceled, done, accepted
list[].notestring
list[].datestring
list[].delivery_datestring
list[].numberstring
list[].deviceobject
list[].device._idstring
list[].device.namestring
list[].device.device_idstring
list[].currencyobject
list[].currency._idstring (objectId)
list[].currency.to_currency_idstring (objectId)
list[].currency.uuidnumber
list[].currency.namestring
list[].currency.valuenumber
list[].currency.symbolstring
list[].currency.sidestringOne of: start, end
list[].currency.numeratornumber
list[].currency.denominatornumber
list[].currency.round_typestringOne of: floor, ceil, round
list[].currency.precisionnumber
list[].currency_idstring
list[].total_to_paynumber
list[].total_pricenumber
list[].discountnumber
list[].total_discountnumber
list[].discountsobject[]
list[].discounts[]._idstring
list[].discounts[].namestring
list[].discounts[].valuenumber
list[].discounts[].apply_typestringOne of: percent, cash
list[].discounts[].currency_idstring
list[].productsobject[]
list[].delivery_addressobject
list[].delivery_address.longnumber
list[].delivery_address.latnumber
list[].delivery_address.human_addressobject
list[].total_salenumber
list[].total_amountnumber
list[].trade_statusstringOne of: zero, partial, fully
list[].tradesobject[]
list[].trades[]._idstring
list[].trades[].typestringOne of: b2b, b2c
list[].trades[].organization_idstring
list[].trades[].statestringOne of: new, in_progress, draft, canceled, done
list[].trades[].state_idstring
list[].trades[].numberstring
list[].trades[].uuidnumber
list[].trades[].currencyobject
list[].trades[].cashbox_idstring
list[].trades[].calc_tax_after_discountboolean
list[].trades[].sale_settingsobject
list[].trades[].total_extra_costnumber
list[].trades[].total_effected_extra_costnumber
list[].custom_fieldsobject[]
list[].custom_fields[]._idstring
list[].custom_fields[].valuestring
totalnumber
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "list": [
      {
        "_id": "string",
        "created_at": "string",
        "updated_at": "string",
        "name": "string",
        "uuid": "A1024",
        "visit_id": "67b486d242ed76693cd2cc59",
        "code": "67b486d242ed76693cd2cc59",
        "organization_id": "67b486d242ed76693cd2cc59",
        "organization": {
          "_id": null,
          "name": null
        },
        "customer_id": "67b486d242ed76693cd2cc59",
        "customer": {
          "_id": null,
          "type": null,
          "phone_number": null,
          "phone_numbers": null,
          "name": null,
          "image": null,
          "custom_fields": null
        },
        "customer_assistant": {
          "_id": null,
          "name": null,
          "type": null
        },
        "customer_assistant_hierarchy": [],
        "responsible_id": "string",
        "customer_image_url": "string",
        "responsible": {
          "_id": null,
          "full_name": null
        },
        "price_id": "string",
        "price": {
          "_id": null,
          "name": null,
          "short_name": null,
          "code": null
        },
        "state_id": "string",
        "state": "new",
        "note": "string",
        "date": "string",
        "delivery_date": "string",
        "number": "string",
        "device": {
          "_id": null,
          "name": null,
          "device_id": null
        },
        "currency": {
          "_id": null,
          "to_currency_id": null,
          "uuid": null,
          "name": null,
          "value": null,
          "symbol": null,
          "side": null,
          "numerator": null,
          "denominator": null,
          "round_type": null,
          "precision": null
        },
        "currency_id": "string",
        "total_to_pay": 0,
        "total_price": 0,
        "discount": 0,
        "total_discount": 0,
        "discounts": [],
        "products": [],
        "delivery_address": {
          "long": null,
          "lat": null,
          "human_address": null
        },
        "total_sale": 0,
        "total_amount": 0,
        "trade_status": "zero",
        "trades": [],
        "custom_fields": []
      }
    ],
    "total": 0
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /sale-order/get-by-id/for-bot/{id} ​

Get a sale order by _id, formatted for bot/external consumption.

Required permission: sale_order · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-by-id/for-bot/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sale-order/get-by-id/for-bot/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/sale-order/get-by-id/for-bot/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/sale-order/get-by-id/for-bot/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);

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

Same response shape as POST /sale-order/create.


This page is generated from the OpenAPI spec.

Bito 2.0 Integration API