Skip to content
Markdown

Sale settings ​

INFO

Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.

GET /sale-settings/get ​

Get all sale-settings

Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения

Пример запроса

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

Тело запроса

Тело запроса не требуется.

Ответ

ПолеТипОписание
booking_product_in_orderbooleanПо умолчанию: false
sell_product_in_negativebooleanПо умолчанию: false
calc_tax_after_discountbooleanПо умолчанию: false
past_date_sellbooleanПо умолчанию: true
max_day_past_date_sellnumber
calc_sale_discount_after_productbooleanПо умолчанию: true
is_tax_activebooleanПо умолчанию: false
is_cashback_activebooleanПо умолчанию: false
trade_statestringДопустимые значения: new, draft, done, cancelled, in_progress. По умолчанию: "new"
show_gross_weightbooleanПо умолчанию: false
show_netto_weightbooleanПо умолчанию: false
debt_approve_by_bossbooleanПо умолчанию: false
discount_approve_by_bossbooleanПо умолчанию: false
on_revisionstringДопустимые значения: warning, error. По умолчанию: "warning"
discountobject
discount.is_enabledbooleanПо умолчанию: false
discount.limit_by_percentnumberПо умолчанию: 0
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "booking_product_in_order": false,
    "sell_product_in_negative": false,
    "calc_tax_after_discount": false,
    "past_date_sell": true,
    "max_day_past_date_sell": 0,
    "calc_sale_discount_after_product": true,
    "is_tax_active": false,
    "is_cashback_active": false,
    "trade_state": "new",
    "show_gross_weight": false,
    "show_netto_weight": false,
    "debt_approve_by_boss": false,
    "discount_approve_by_boss": false,
    "on_revision": "warning",
    "discount": {
      "is_enabled": false,
      "limit_by_percent": 0
    }
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /sale-settings/set ​

This method allows updating sale-settings in the account.

Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения

Пример запроса

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/sale-settings/set' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "booking_product_in_order": false,
  "sell_product_in_negative": false,
  "calc_tax_after_discount": false,
  "is_tax_active": false,
  "is_cashback_active": false,
  "show_gross_weight": false,
  "show_netto_weight": false,
  "debt_approve_by_boss": false,
  "discount_approve_by_boss": false,
  "past_date_sell": false,
  "max_day_past_date_sell": 0,
  "on_revision": "error",
  "on_black_list_customer": "allow",
  "trade_state": "new",
  "discount.is_enabled": false,
  "discount.limit_by_percent": 0,
  "is_customer_required": false,
  "book_by_open_ticket": false,
  "multi_currency_receipt": false
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sale-settings/set', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "booking_product_in_order": false,
    "sell_product_in_negative": false,
    "calc_tax_after_discount": false,
    "is_tax_active": false,
    "is_cashback_active": false,
    "show_gross_weight": false,
    "show_netto_weight": false,
    "debt_approve_by_boss": false,
    "discount_approve_by_boss": false,
    "past_date_sell": false,
    "max_day_past_date_sell": 0,
    "on_revision": "error",
    "on_black_list_customer": "allow",
    "trade_state": "new",
    "discount.is_enabled": false,
    "discount.limit_by_percent": 0,
    "is_customer_required": false,
    "book_by_open_ticket": false,
    "multi_currency_receipt": false
  }),
})
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-settings/set",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "booking_product_in_order": False,
        "sell_product_in_negative": False,
        "calc_tax_after_discount": False,
        "is_tax_active": False,
        "is_cashback_active": False,
        "show_gross_weight": False,
        "show_netto_weight": False,
        "debt_approve_by_boss": False,
        "discount_approve_by_boss": False,
        "past_date_sell": False,
        "max_day_past_date_sell": 0,
        "on_revision": "error",
        "on_black_list_customer": "allow",
        "trade_state": "new",
        "discount.is_enabled": False,
        "discount.limit_by_percent": 0,
        "is_customer_required": False,
        "book_by_open_ticket": False,
        "multi_currency_receipt": False,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "booking_product_in_order": false,
  "sell_product_in_negative": false,
  "calc_tax_after_discount": false,
  "is_tax_active": false,
  "is_cashback_active": false,
  "show_gross_weight": false,
  "show_netto_weight": false,
  "debt_approve_by_boss": false,
  "discount_approve_by_boss": false,
  "past_date_sell": false,
  "max_day_past_date_sell": 0,
  "on_revision": "error",
  "on_black_list_customer": "allow",
  "trade_state": "new",
  "discount.is_enabled": false,
  "discount.limit_by_percent": 0,
  "is_customer_required": false,
  "book_by_open_ticket": false,
  "multi_currency_receipt": false
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
booking_product_in_orderbooleanНет
sell_product_in_negativebooleanНет
calc_tax_after_discountbooleanНет
is_tax_activebooleanНет
is_cashback_activebooleanНет
show_gross_weightbooleanНет
show_netto_weightbooleanНет
debt_approve_by_bossbooleanНет
discount_approve_by_bossbooleanНет
past_date_sellbooleanНет
max_day_past_date_sellnumberНет
on_revisionstringНетДопустимые значения: error, warning
on_black_list_customerstringНетДопустимые значения: allow, warning, error
trade_statestringНетДопустимые значения: new, in_progress, canceled, done
discount.is_enabledbooleanНетSend this dotted key as is, not inside a nested discount object.
discount.limit_by_percentnumberНетSend this dotted key as is, not inside a nested discount object.
is_customer_requiredbooleanНет
book_by_open_ticketbooleanНет
multi_currency_receiptbooleanНет
json
{
  "booking_product_in_order": false,
  "sell_product_in_negative": false,
  "calc_tax_after_discount": false,
  "is_tax_active": false,
  "is_cashback_active": false,
  "show_gross_weight": false,
  "show_netto_weight": false,
  "debt_approve_by_boss": false,
  "discount_approve_by_boss": false,
  "past_date_sell": false,
  "max_day_past_date_sell": 0,
  "on_revision": "error",
  "on_black_list_customer": "allow",
  "trade_state": "new",
  "discount.is_enabled": false,
  "discount.limit_by_percent": 0,
  "is_customer_required": false,
  "book_by_open_ticket": false,
  "multi_currency_receipt": false
}

Ответ

Структура ответа совпадает с GET /sale-settings/get.


Эта страница сгенерирована из спецификации OpenAPI.

Bito 2.0 Integration API