Skip to content
View as Markdown

Extra cost ​

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 /extra-cost/create ​

This method allows adding extra-cost into the account.

Required permission: extra_cost_create · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/extra-cost/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "is_affect_price": false,
  "recommended_amount": 0,
  "max_amount": 0,
  "currency_id": "646b0c2f3d4e1a001f8b4567",
  "payment_type_id": "646b0c2f3d4e1a001f8b4567",
  "status": "active"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/extra-cost/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string",
    "is_affect_price": false,
    "recommended_amount": 0,
    "max_amount": 0,
    "currency_id": "646b0c2f3d4e1a001f8b4567",
    "payment_type_id": "646b0c2f3d4e1a001f8b4567",
    "status": "active"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/extra-cost/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
        "is_affect_price": False,
        "recommended_amount": 0,
        "max_amount": 0,
        "currency_id": "646b0c2f3d4e1a001f8b4567",
        "payment_type_id": "646b0c2f3d4e1a001f8b4567",
        "status": "active",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "string",
  "is_affect_price": false,
  "recommended_amount": 0,
  "max_amount": 0,
  "currency_id": "646b0c2f3d4e1a001f8b4567",
  "payment_type_id": "646b0c2f3d4e1a001f8b4567",
  "status": "active"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/extra-cost/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
namestringYes
is_affect_pricebooleanYesDefault: false
distribution_methodstringNoRequired when is_affect_price is true.. One of: byPrice, byAmount, byGrossWeight, byVolume, manual. Default: "byPrice"
recommended_amountnumberYesDefault: 0
max_amountnumberYesDefault: 0
currency_idstringYes
payment_type_idstringYes
user_typestringNoOne of: supplier, employee, customer, person, other. Default: "supplier"
customer_idstringNo
supplier_idstringNo
employee_idstringNo
person_idstringNo
statusstringYesOne of: active, inactive. Default: "active"
notestringNo
json
{
  "name": "string",
  "is_affect_price": false,
  "distribution_method": "byPrice",
  "recommended_amount": 0,
  "max_amount": 0,
  "currency_id": "646b0c2f3d4e1a001f8b4567",
  "payment_type_id": "646b0c2f3d4e1a001f8b4567",
  "user_type": "supplier",
  "customer_id": "646b0c2f3d4e1a001f8b4567",
  "supplier_id": "646b0c2f3d4e1a001f8b4567",
  "employee_id": "646b0c2f3d4e1a001f8b4567",
  "person_id": "646b0c2f3d4e1a001f8b4567",
  "status": "active",
  "note": "string"
}

Response

FieldTypeDescription
namestring
is_affect_priceboolean
distribution_methodstring
amountnumber
should_create_transactionboolean
recommended_amountnumber
max_amountnumber
notestring
statusstringOne of: active, inactive
payment_typeobject
payment_type._idstring
payment_type.namestring
payment_type.user_typestring
currency_idstring
currencyobject
currency._idstring
currency.namestring
updated_by_userobject
updated_by_user._idstring
updated_by_user.full_namestring
created_by_userobject
created_by_user._idstring
created_by_user.full_namestring
employeeobject
employee._idstring
employee.full_namestring
customerobject
customer._idstring
customer.namestring
supplierobject
supplier._idstring
supplier.namestring
personobject
person._idstring
person.namestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "name": "string",
    "is_affect_price": false,
    "distribution_method": "string",
    "amount": 0,
    "should_create_transaction": false,
    "recommended_amount": 0,
    "max_amount": 0,
    "note": "string",
    "status": "active",
    "payment_type": {
      "_id": "string",
      "name": "string",
      "user_type": "string"
    },
    "currency_id": "string",
    "currency": {
      "_id": "string",
      "name": "string"
    },
    "updated_by_user": {
      "_id": "string",
      "full_name": "string"
    },
    "created_by_user": {
      "_id": "string",
      "full_name": "string"
    },
    "employee": {
      "_id": "string",
      "full_name": "string"
    },
    "customer": {
      "_id": "string",
      "name": "string"
    },
    "supplier": {
      "_id": "string",
      "name": "string"
    },
    "person": {
      "_id": "string",
      "name": "string"
    }
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /extra-cost/update ​

This method allows updating extra-cost in the account.

Required permission: extra_cost_update · how permissions work

Example request

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/extra-cost/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "is_affect_price": false,
  "recommended_amount": 0,
  "max_amount": 0,
  "currency_id": "646b0c2f3d4e1a001f8b4567",
  "payment_type_id": "646b0c2f3d4e1a001f8b4567",
  "status": "active",
  "_id": "646b0c2f3d4e1a001f8b4567"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/extra-cost/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string",
    "is_affect_price": false,
    "recommended_amount": 0,
    "max_amount": 0,
    "currency_id": "646b0c2f3d4e1a001f8b4567",
    "payment_type_id": "646b0c2f3d4e1a001f8b4567",
    "status": "active",
    "_id": "646b0c2f3d4e1a001f8b4567"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/extra-cost/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
        "is_affect_price": False,
        "recommended_amount": 0,
        "max_amount": 0,
        "currency_id": "646b0c2f3d4e1a001f8b4567",
        "payment_type_id": "646b0c2f3d4e1a001f8b4567",
        "status": "active",
        "_id": "646b0c2f3d4e1a001f8b4567",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "string",
  "is_affect_price": false,
  "recommended_amount": 0,
  "max_amount": 0,
  "currency_id": "646b0c2f3d4e1a001f8b4567",
  "payment_type_id": "646b0c2f3d4e1a001f8b4567",
  "status": "active",
  "_id": "646b0c2f3d4e1a001f8b4567"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/extra-cost/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
namestringYes
is_affect_pricebooleanYesDefault: false
distribution_methodstringNoRequired when is_affect_price is true.. One of: byPrice, byAmount, byGrossWeight, byVolume, manual. Default: "byPrice"
recommended_amountnumberYesDefault: 0
max_amountnumberYesDefault: 0
currency_idstringYes
payment_type_idstringYes
user_typestringNoOne of: supplier, employee, customer, person, other. Default: "supplier"
customer_idstringNo
supplier_idstringNo
employee_idstringNo
person_idstringNo
statusstringYesOne of: active, inactive. Default: "active"
notestringNo
json
{
  "_id": "646b0c2f3d4e1a001f8b4567",
  "name": "string",
  "is_affect_price": false,
  "distribution_method": "byPrice",
  "recommended_amount": 0,
  "max_amount": 0,
  "currency_id": "646b0c2f3d4e1a001f8b4567",
  "payment_type_id": "646b0c2f3d4e1a001f8b4567",
  "user_type": "supplier",
  "customer_id": "646b0c2f3d4e1a001f8b4567",
  "supplier_id": "646b0c2f3d4e1a001f8b4567",
  "employee_id": "646b0c2f3d4e1a001f8b4567",
  "person_id": "646b0c2f3d4e1a001f8b4567",
  "status": "active",
  "note": "string"
}

Response

Same response shape as POST /extra-cost/create.

DELETE /extra-cost/delete/{id} ​

Delete a extra-cost

Required permission: extra_cost_delete · how permissions work

Example request

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

Get all extra-costs

Required permission: extra_cost · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/extra-cost/get-all' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/extra-cost/get-all', {
  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/extra-cost/get-all",
    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/extra-cost/get-all');
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
statusstringNoOne of: active, inactive
distribution_method_nestringNoOne of: byPrice, byAmount, byGrossWeight, byVolume, manual

Request body

No request body.

Response

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "name": "string",
      "is_affect_price": false,
      "distribution_method": "string",
      "amount": 0,
      "should_create_transaction": false,
      "recommended_amount": 0,
      "max_amount": 0,
      "note": "string",
      "status": "active",
      "payment_type": {
        "_id": "string",
        "name": "string",
        "user_type": "string"
      },
      "currency_id": "string",
      "currency": {
        "_id": "string",
        "name": "string"
      },
      "updated_by_user": {
        "_id": "string",
        "full_name": "string"
      },
      "created_by_user": {
        "_id": "string",
        "full_name": "string"
      },
      "employee": {
        "_id": "string",
        "full_name": "string"
      },
      "customer": {
        "_id": "string",
        "name": "string"
      },
      "supplier": {
        "_id": "string",
        "name": "string"
      },
      "person": {
        "_id": "string",
        "name": "string"
      }
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}

GET /extra-cost/get-by-id/{id} ​

Get extra-cost using its _id

Required permission: extra_cost · how permissions work

Example request

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

GET /extra-cost/get-deleted ​

Get deleted extra-cost ids

Required permission: extra_cost · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/extra-cost/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/extra-cost/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/extra-cost/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/extra-cost/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"
}

POST /extra-cost/get-paging ​

Get extra-cost by paging

Required permission: extra_cost · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/extra-cost/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/extra-cost/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/extra-cost/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/extra-cost/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
searchstringNo
distribution_method_nestringNoOne of: byPrice, byAmount, byGrossWeight, byVolume, manual. Default: "byPrice"
statusstringNoOne of: active, inactive
json
{
  "page": 1,
  "limit": 20,
  "search": "string",
  "distribution_method_ne": "byPrice",
  "status": "active"
}

Response

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

FieldTypeDescription
namestring
is_affect_priceboolean
distribution_methodstring
amountnumber
should_create_transactionboolean
recommended_amountnumber
max_amountnumber
notestring
statusstringOne of: active, inactive
payment_typeobject
payment_type._idstring
payment_type.namestring
payment_type.user_typestring
currency_idstring
currencyobject
currency._idstring
currency.namestring
updated_by_userobject
updated_by_user._idstring
updated_by_user.full_namestring
created_by_userobject
created_by_user._idstring
created_by_user.full_namestring
employeeobject
employee._idstring
employee.full_namestring
customerobject
customer._idstring
customer.namestring
supplierobject
supplier._idstring
supplier.namestring
personobject
person._idstring
person.namestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "name": "string",
        "is_affect_price": false,
        "distribution_method": "string",
        "amount": 0,
        "should_create_transaction": false,
        "recommended_amount": 0,
        "max_amount": 0,
        "note": "string",
        "status": "active",
        "payment_type": {
          "_id": "string",
          "name": "string",
          "user_type": "string"
        },
        "currency_id": "string",
        "currency": {
          "_id": "string",
          "name": "string"
        },
        "updated_by_user": {
          "_id": "string",
          "full_name": "string"
        },
        "created_by_user": {
          "_id": "string",
          "full_name": "string"
        },
        "employee": {
          "_id": "string",
          "full_name": "string"
        },
        "customer": {
          "_id": "string",
          "name": "string"
        },
        "supplier": {
          "_id": "string",
          "name": "string"
        },
        "person": {
          "_id": "string",
          "name": "string"
        }
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

This page is generated from the OpenAPI spec.

Bito 2.0 Integration API