Skip to content
View as Markdown

Message settings ​

Outbound messaging settings

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 /message-settings/get ​

Get the message settings for a specific (bot_type, message_type) combination. Auto-creates the document with defaults if it does not exist yet. Because the resource is keyed by a composite — not an ObjectId — the request requires a body with both keys.

Required permission: none — closed to an app that declares permissions · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/message-settings/get' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "bot_type": "CUSTOMER_BOT",
  "message_type": "TRADE"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/message-settings/get', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "bot_type": "CUSTOMER_BOT",
    "message_type": "TRADE"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/message-settings/get",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "bot_type": "CUSTOMER_BOT",
        "message_type": "TRADE",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "bot_type": "CUSTOMER_BOT",
  "message_type": "TRADE"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/message-settings/get');
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
bot_typestringYesBot channel type. One of: CUSTOMER_BOT, REPORT_BOT, SMS
message_typestringYesBusiness event category the settings apply to. One of: TRADE, PURCHASE, TRANSACTION, TRANSFER, PRODUCTION, TASK
json
{
  "bot_type": "CUSTOMER_BOT",
  "message_type": "TRADE"
}

Response

FieldTypeDescription
_idstringDocument ObjectId
account_idstringTenant identifier
bot_typestringBot channel type. One of: CUSTOMER_BOT, REPORT_BOT, SMS
message_typestringBusiness event category the settings apply to. One of: TRADE, PURCHASE, TRANSACTION, TRANSFER, PRODUCTION, TASK
is_task_createdboolean
is_task_closedboolean
is_refundany
sold_atany
stateany
organizationany
sellerany
customerany
noteobject
note.showbooleanWhether this field is shown in the message
note.positionintegerDisplay position (0-based)
total_amountany
itemsany
discountany
included_taxany
added_taxany
totalany
paymentsany
by_balanceany
is_installment_planany
debtany
applied_cashbacksany
initial_paymentany
purchaseany
balanceany
earned_cashbackany
marksany
dateany
responsibleany
supplierany
purchase_created_atany
ordersany
transactionany
transaction_typeany
cashboxany
cashierany
invoiceany
tradeany
employeeany
personany
amountany
payment_methodany
payment_typeany
production_numberany
used_warehouseany
produced_warehouseany
used_dateany
produced_dateany
currencyany
route_sheetany
production_created_byany
production_codeany
total_producedany
total_usedany
total_costany
total_expenseany
linkany
state_changesany
state_changeany
transferany
sender_organizationany
receiver_organizationany
sender_warehouseany
sender_employeeany
reasonany
productsany
customer_balanceany
transfer_created_atany
production_created_atany
changeany
sign_amountany
numberany
transaction_created_byany
device_nameany
total_discountany
task_typeany
task_descriptionany
resultany
task_deadlineany
task_created_atany
phone_numberany
created_atstring (date-time)
updated_atstring (date-time)
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "account_id": "string",
    "bot_type": "CUSTOMER_BOT",
    "message_type": "TRADE",
    "is_task_created": false,
    "is_task_closed": false,
    "is_refund": null,
    "sold_at": null,
    "state": null,
    "organization": null,
    "seller": null,
    "customer": null,
    "note": {
      "show": false,
      "position": 0
    },
    "total_amount": null,
    "items": null,
    "discount": null,
    "included_tax": null,
    "added_tax": null,
    "total": null,
    "payments": null,
    "by_balance": null,
    "is_installment_plan": null,
    "debt": null,
    "applied_cashbacks": null,
    "initial_payment": null,
    "purchase": null,
    "balance": null,
    "earned_cashback": null,
    "marks": null,
    "date": null,
    "responsible": null,
    "supplier": null,
    "purchase_created_at": null,
    "orders": null,
    "transaction": null,
    "transaction_type": null,
    "cashbox": null,
    "cashier": null,
    "invoice": null,
    "trade": null,
    "employee": null,
    "person": null,
    "amount": null,
    "payment_method": null,
    "payment_type": null,
    "production_number": null,
    "used_warehouse": null,
    "produced_warehouse": null,
    "used_date": null,
    "produced_date": null,
    "currency": null,
    "route_sheet": null,
    "production_created_by": null,
    "production_code": null,
    "total_produced": null,
    "total_used": null,
    "total_cost": null,
    "total_expense": null,
    "link": null,
    "state_changes": null,
    "state_change": null,
    "transfer": null,
    "sender_organization": null,
    "receiver_organization": null,
    "sender_warehouse": null,
    "sender_employee": null,
    "reason": null,
    "products": null,
    "customer_balance": null,
    "transfer_created_at": null,
    "production_created_at": null,
    "change": null,
    "sign_amount": null,
    "number": null,
    "transaction_created_by": null,
    "device_name": null,
    "total_discount": null,
    "task_type": null,
    "task_description": null,
    "result": null,
    "task_deadline": null,
    "task_created_at": null,
    "phone_number": null,
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": "2025-05-01T12:00:00Z"
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /message-settings/set ​

Create or update the message settings for a specific (bot_type, message_type) combination. All ~80 DetailSettings toggle fields (show + position) are optional — omitted fields keep their existing values on update, or receive defaults on create.

Required permission: none — closed to an app that declares permissions · how permissions work

Example request

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/message-settings/set' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "bot_type": "CUSTOMER_BOT",
  "message_type": "TRADE"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/message-settings/set', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "bot_type": "CUSTOMER_BOT",
    "message_type": "TRADE"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/message-settings/set",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "bot_type": "CUSTOMER_BOT",
        "message_type": "TRADE",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "bot_type": "CUSTOMER_BOT",
  "message_type": "TRADE"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/message-settings/set');
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
bot_typestringYesBot channel type. One of: CUSTOMER_BOT, REPORT_BOT, SMS
message_typestringYesBusiness event category the settings apply to. One of: TRADE, PURCHASE, TRANSACTION, TRANSFER, PRODUCTION, TASK
is_task_createdbooleanNoNotify when a task is created
is_task_closedbooleanNoNotify when a task is closed
is_refundobjectNo
is_refund.showbooleanYesWhether this field is shown in the message
is_refund.positionintegerYesDisplay position (0-based)
sold_atobjectNo
sold_at.showbooleanYesWhether this field is shown in the message
sold_at.positionintegerYesDisplay position (0-based)
stateobjectNo
state.showbooleanYesWhether this field is shown in the message
state.positionintegerYesDisplay position (0-based)
organizationobjectNo
organization.showbooleanYesWhether this field is shown in the message
organization.positionintegerYesDisplay position (0-based)
sellerobjectNo
seller.showbooleanYesWhether this field is shown in the message
seller.positionintegerYesDisplay position (0-based)
customerobjectNo
customer.showbooleanYesWhether this field is shown in the message
customer.positionintegerYesDisplay position (0-based)
noteobjectNo
note.showbooleanYesWhether this field is shown in the message
note.positionintegerYesDisplay position (0-based)
total_amountobjectNo
total_amount.showbooleanYesWhether this field is shown in the message
total_amount.positionintegerYesDisplay position (0-based)
itemsobjectNo
items.showbooleanYesWhether this field is shown in the message
items.positionintegerYesDisplay position (0-based)
discountobjectNo
discount.showbooleanYesWhether this field is shown in the message
discount.positionintegerYesDisplay position (0-based)
included_taxobjectNo
included_tax.showbooleanYesWhether this field is shown in the message
included_tax.positionintegerYesDisplay position (0-based)
added_taxobjectNo
added_tax.showbooleanYesWhether this field is shown in the message
added_tax.positionintegerYesDisplay position (0-based)
totalobjectNo
total.showbooleanYesWhether this field is shown in the message
total.positionintegerYesDisplay position (0-based)
paymentsobjectNo
payments.showbooleanYesWhether this field is shown in the message
payments.positionintegerYesDisplay position (0-based)
by_balanceobjectNo
by_balance.showbooleanYesWhether this field is shown in the message
by_balance.positionintegerYesDisplay position (0-based)
is_installment_planobjectNo
is_installment_plan.showbooleanYesWhether this field is shown in the message
is_installment_plan.positionintegerYesDisplay position (0-based)
debtobjectNo
debt.showbooleanYesWhether this field is shown in the message
debt.positionintegerYesDisplay position (0-based)
applied_cashbacksobjectNo
applied_cashbacks.showbooleanYesWhether this field is shown in the message
applied_cashbacks.positionintegerYesDisplay position (0-based)
initial_paymentobjectNo
initial_payment.showbooleanYesWhether this field is shown in the message
initial_payment.positionintegerYesDisplay position (0-based)
purchaseobjectNo
purchase.showbooleanYesWhether this field is shown in the message
purchase.positionintegerYesDisplay position (0-based)
balanceobjectNo
balance.showbooleanYesWhether this field is shown in the message
balance.positionintegerYesDisplay position (0-based)
earned_cashbackobjectNo
earned_cashback.showbooleanYesWhether this field is shown in the message
earned_cashback.positionintegerYesDisplay position (0-based)
marksobjectNo
marks.showbooleanYesWhether this field is shown in the message
marks.positionintegerYesDisplay position (0-based)
dateobjectNo
date.showbooleanYesWhether this field is shown in the message
date.positionintegerYesDisplay position (0-based)
responsibleobjectNo
responsible.showbooleanYesWhether this field is shown in the message
responsible.positionintegerYesDisplay position (0-based)
supplierobjectNo
supplier.showbooleanYesWhether this field is shown in the message
supplier.positionintegerYesDisplay position (0-based)
purchase_created_atobjectNo
purchase_created_at.showbooleanYesWhether this field is shown in the message
purchase_created_at.positionintegerYesDisplay position (0-based)
ordersobjectNo
orders.showbooleanYesWhether this field is shown in the message
orders.positionintegerYesDisplay position (0-based)
transactionobjectNo
transaction.showbooleanYesWhether this field is shown in the message
transaction.positionintegerYesDisplay position (0-based)
transaction_typeobjectNo
transaction_type.showbooleanYesWhether this field is shown in the message
transaction_type.positionintegerYesDisplay position (0-based)
cashboxobjectNo
cashbox.showbooleanYesWhether this field is shown in the message
cashbox.positionintegerYesDisplay position (0-based)
cashierobjectNo
cashier.showbooleanYesWhether this field is shown in the message
cashier.positionintegerYesDisplay position (0-based)
invoiceobjectNo
invoice.showbooleanYesWhether this field is shown in the message
invoice.positionintegerYesDisplay position (0-based)
tradeobjectNo
trade.showbooleanYesWhether this field is shown in the message
trade.positionintegerYesDisplay position (0-based)
employeeobjectNo
employee.showbooleanYesWhether this field is shown in the message
employee.positionintegerYesDisplay position (0-based)
personobjectNo
person.showbooleanYesWhether this field is shown in the message
person.positionintegerYesDisplay position (0-based)
amountobjectNo
amount.showbooleanYesWhether this field is shown in the message
amount.positionintegerYesDisplay position (0-based)
payment_methodobjectNo
payment_method.showbooleanYesWhether this field is shown in the message
payment_method.positionintegerYesDisplay position (0-based)
payment_typeobjectNo
payment_type.showbooleanYesWhether this field is shown in the message
payment_type.positionintegerYesDisplay position (0-based)
production_numberobjectNo
production_number.showbooleanYesWhether this field is shown in the message
production_number.positionintegerYesDisplay position (0-based)
used_warehouseobjectNo
used_warehouse.showbooleanYesWhether this field is shown in the message
used_warehouse.positionintegerYesDisplay position (0-based)
produced_warehouseobjectNo
produced_warehouse.showbooleanYesWhether this field is shown in the message
produced_warehouse.positionintegerYesDisplay position (0-based)
used_dateobjectNo
used_date.showbooleanYesWhether this field is shown in the message
used_date.positionintegerYesDisplay position (0-based)
produced_dateobjectNo
produced_date.showbooleanYesWhether this field is shown in the message
produced_date.positionintegerYesDisplay position (0-based)
currencyobjectNo
currency.showbooleanYesWhether this field is shown in the message
currency.positionintegerYesDisplay position (0-based)
route_sheetobjectNo
route_sheet.showbooleanYesWhether this field is shown in the message
route_sheet.positionintegerYesDisplay position (0-based)
production_created_byobjectNo
production_created_by.showbooleanYesWhether this field is shown in the message
production_created_by.positionintegerYesDisplay position (0-based)
production_codeobjectNo
production_code.showbooleanYesWhether this field is shown in the message
production_code.positionintegerYesDisplay position (0-based)
total_producedobjectNo
total_produced.showbooleanYesWhether this field is shown in the message
total_produced.positionintegerYesDisplay position (0-based)
total_usedobjectNo
total_used.showbooleanYesWhether this field is shown in the message
total_used.positionintegerYesDisplay position (0-based)
total_costobjectNo
total_cost.showbooleanYesWhether this field is shown in the message
total_cost.positionintegerYesDisplay position (0-based)
total_expenseobjectNo
total_expense.showbooleanYesWhether this field is shown in the message
total_expense.positionintegerYesDisplay position (0-based)
linkobjectNo
link.showbooleanYesWhether this field is shown in the message
link.positionintegerYesDisplay position (0-based)
state_changesobjectNo
state_changes.showbooleanYesWhether this field is shown in the message
state_changes.positionintegerYesDisplay position (0-based)
state_changeobjectNo
state_change.showbooleanYesWhether this field is shown in the message
state_change.positionintegerYesDisplay position (0-based)
transferobjectNo
transfer.showbooleanYesWhether this field is shown in the message
transfer.positionintegerYesDisplay position (0-based)
sender_organizationobjectNo
sender_organization.showbooleanYesWhether this field is shown in the message
sender_organization.positionintegerYesDisplay position (0-based)
receiver_organizationobjectNo
receiver_organization.showbooleanYesWhether this field is shown in the message
receiver_organization.positionintegerYesDisplay position (0-based)
sender_warehouseobjectNo
sender_warehouse.showbooleanYesWhether this field is shown in the message
sender_warehouse.positionintegerYesDisplay position (0-based)
sender_employeeobjectNo
sender_employee.showbooleanYesWhether this field is shown in the message
sender_employee.positionintegerYesDisplay position (0-based)
reasonobjectNo
reason.showbooleanYesWhether this field is shown in the message
reason.positionintegerYesDisplay position (0-based)
productsobjectNo
products.showbooleanYesWhether this field is shown in the message
products.positionintegerYesDisplay position (0-based)
customer_balanceobjectNo
customer_balance.showbooleanYesWhether this field is shown in the message
customer_balance.positionintegerYesDisplay position (0-based)
transfer_created_atobjectNo
transfer_created_at.showbooleanYesWhether this field is shown in the message
transfer_created_at.positionintegerYesDisplay position (0-based)
production_created_atobjectNo
production_created_at.showbooleanYesWhether this field is shown in the message
production_created_at.positionintegerYesDisplay position (0-based)
changeobjectNo
change.showbooleanYesWhether this field is shown in the message
change.positionintegerYesDisplay position (0-based)
sign_amountobjectNo
sign_amount.showbooleanYesWhether this field is shown in the message
sign_amount.positionintegerYesDisplay position (0-based)
numberobjectNo
number.showbooleanYesWhether this field is shown in the message
number.positionintegerYesDisplay position (0-based)
transaction_created_byobjectNo
transaction_created_by.showbooleanYesWhether this field is shown in the message
transaction_created_by.positionintegerYesDisplay position (0-based)
device_nameobjectNo
device_name.showbooleanYesWhether this field is shown in the message
device_name.positionintegerYesDisplay position (0-based)
total_discountobjectNo
total_discount.showbooleanYesWhether this field is shown in the message
total_discount.positionintegerYesDisplay position (0-based)
task_typeobjectNo
task_type.showbooleanYesWhether this field is shown in the message
task_type.positionintegerYesDisplay position (0-based)
task_descriptionobjectNo
task_description.showbooleanYesWhether this field is shown in the message
task_description.positionintegerYesDisplay position (0-based)
resultobjectNo
result.showbooleanYesWhether this field is shown in the message
result.positionintegerYesDisplay position (0-based)
task_deadlineobjectNo
task_deadline.showbooleanYesWhether this field is shown in the message
task_deadline.positionintegerYesDisplay position (0-based)
task_created_atobjectNo
task_created_at.showbooleanYesWhether this field is shown in the message
task_created_at.positionintegerYesDisplay position (0-based)
phone_numberobjectNo
phone_number.showbooleanYesWhether this field is shown in the message
phone_number.positionintegerYesDisplay position (0-based)
currency_rateobjectNo
currency_rate.showbooleanYes
currency_rate.positionnumberYes
supplier_balanceobjectNo
supplier_balance.showbooleanYes
supplier_balance.positionnumberYes
json
{
  "bot_type": "CUSTOMER_BOT",
  "message_type": "TRADE",
  "is_task_created": false,
  "is_task_closed": false,
  "is_refund": {
    "show": false,
    "position": 0
  },
  "sold_at": {
    "show": false,
    "position": 0
  },
  "state": {
    "show": false,
    "position": 0
  },
  "organization": {
    "show": false,
    "position": 0
  },
  "seller": {
    "show": false,
    "position": 0
  },
  "customer": {
    "show": false,
    "position": 0
  },
  "note": {
    "show": false,
    "position": 0
  },
  "total_amount": {
    "show": false,
    "position": 0
  },
  "items": {
    "show": false,
    "position": 0
  },
  "discount": {
    "show": false,
    "position": 0
  },
  "included_tax": {
    "show": false,
    "position": 0
  },
  "added_tax": {
    "show": false,
    "position": 0
  },
  "total": {
    "show": false,
    "position": 0
  },
  "payments": {
    "show": false,
    "position": 0
  },
  "by_balance": {
    "show": false,
    "position": 0
  },
  "is_installment_plan": {
    "show": false,
    "position": 0
  },
  "debt": {
    "show": false,
    "position": 0
  },
  "applied_cashbacks": {
    "show": false,
    "position": 0
  },
  "initial_payment": {
    "show": false,
    "position": 0
  },
  "purchase": {
    "show": false,
    "position": 0
  },
  "balance": {
    "show": false,
    "position": 0
  },
  "earned_cashback": {
    "show": false,
    "position": 0
  },
  "marks": {
    "show": false,
    "position": 0
  },
  "date": {
    "show": false,
    "position": 0
  },
  "responsible": {
    "show": false,
    "position": 0
  },
  "supplier": {
    "show": false,
    "position": 0
  },
  "purchase_created_at": {
    "show": false,
    "position": 0
  },
  "orders": {
    "show": false,
    "position": 0
  },
  "transaction": {
    "show": false,
    "position": 0
  },
  "transaction_type": {
    "show": false,
    "position": 0
  },
  "cashbox": {
    "show": false,
    "position": 0
  },
  "cashier": {
    "show": false,
    "position": 0
  },
  "invoice": {
    "show": false,
    "position": 0
  },
  "trade": {
    "show": false,
    "position": 0
  },
  "employee": {
    "show": false,
    "position": 0
  },
  "person": {
    "show": false,
    "position": 0
  },
  "amount": {
    "show": false,
    "position": 0
  },
  "payment_method": {
    "show": false,
    "position": 0
  },
  "payment_type": {
    "show": false,
    "position": 0
  },
  "production_number": {
    "show": false,
    "position": 0
  },
  "used_warehouse": {
    "show": false,
    "position": 0
  },
  "produced_warehouse": {
    "show": false,
    "position": 0
  },
  "used_date": {
    "show": false,
    "position": 0
  },
  "produced_date": {
    "show": false,
    "position": 0
  },
  "currency": {
    "show": false,
    "position": 0
  },
  "route_sheet": {
    "show": false,
    "position": 0
  },
  "production_created_by": {
    "show": false,
    "position": 0
  },
  "production_code": {
    "show": false,
    "position": 0
  },
  "total_produced": {
    "show": false,
    "position": 0
  },
  "total_used": {
    "show": false,
    "position": 0
  },
  "total_cost": {
    "show": false,
    "position": 0
  },
  "total_expense": {
    "show": false,
    "position": 0
  },
  "link": {
    "show": false,
    "position": 0
  },
  "state_changes": {
    "show": false,
    "position": 0
  },
  "state_change": {
    "show": false,
    "position": 0
  },
  "transfer": {
    "show": false,
    "position": 0
  },
  "sender_organization": {
    "show": false,
    "position": 0
  },
  "receiver_organization": {
    "show": false,
    "position": 0
  },
  "sender_warehouse": {
    "show": false,
    "position": 0
  },
  "sender_employee": {
    "show": false,
    "position": 0
  },
  "reason": {
    "show": false,
    "position": 0
  },
  "products": {
    "show": false,
    "position": 0
  },
  "customer_balance": {
    "show": false,
    "position": 0
  },
  "transfer_created_at": {
    "show": false,
    "position": 0
  },
  "production_created_at": {
    "show": false,
    "position": 0
  },
  "change": {
    "show": false,
    "position": 0
  },
  "sign_amount": {
    "show": false,
    "position": 0
  },
  "number": {
    "show": false,
    "position": 0
  },
  "transaction_created_by": {
    "show": false,
    "position": 0
  },
  "device_name": {
    "show": false,
    "position": 0
  },
  "total_discount": {
    "show": false,
    "position": 0
  },
  "task_type": {
    "show": false,
    "position": 0
  },
  "task_description": {
    "show": false,
    "position": 0
  },
  "result": {
    "show": false,
    "position": 0
  },
  "task_deadline": {
    "show": false,
    "position": 0
  },
  "task_created_at": {
    "show": false,
    "position": 0
  },
  "phone_number": {
    "show": false,
    "position": 0
  },
  "currency_rate": {
    "show": false,
    "position": 0
  },
  "supplier_balance": {
    "show": false,
    "position": 0
  }
}

Response

Same response shape as POST /message-settings/get.


This page is generated from the OpenAPI spec.

Bito 2.0 Integration API