Skip to content
Markdown

Cashback settings ​

INFO

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

POST /cashback-setting/create ​

This method allows adding cashback-settings into the account.

Нужное разрешение: cashback · как работают разрешения

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/cashback-setting/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "by_amount",
  "is_active": true,
  "organization_id": "67b486d242ed76693cd2cc59"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/cashback-setting/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "type": "by_amount",
    "is_active": true,
    "organization_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/cashback-setting/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "type": "by_amount",
        "is_active": True,
        "organization_id": "67b486d242ed76693cd2cc59",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "type": "by_amount",
  "is_active": true,
  "organization_id": "67b486d242ed76693cd2cc59"
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
typestringДаДопустимые значения: by_amount, all. По умолчанию: "by_amount"
is_activebooleanДаПо умолчанию: true
organization_idstringДа
organization_idsstring[]Нет
cashbacksobject[]НетRequired when type is by_amount.
cashbacks[].cashback_typestringДаДопустимые значения: percent, cash. По умолчанию: "percent"
cashbacks[].min_amountnumberНет
cashbacks[].amountnumberДа
cashbacks[].currency_idstringНетRequired when cashback_type is cash.
cashbacks[].is_all_categoriesbooleanНетПо умолчанию: false
cashbacks[].category_idsstring[]Нет
cashbacks[].item_added_idsstring[]Нет
json
{
  "type": "by_amount",
  "is_active": true,
  "organization_id": "67b486d242ed76693cd2cc59",
  "organization_ids": [
    "63f8b0c4e4b0d3a2f8e4b0c4"
  ],
  "cashbacks": [
    {
      "cashback_type": "percent",
      "min_amount": 0,
      "amount": 0,
      "currency_id": "67b486d242ed76693cd2cc59",
      "is_all_categories": false,
      "category_ids": [],
      "item_added_ids": []
    }
  ]
}

Ответ

ПолеТипОписание
typestringДопустимые значения: all, by_amount
is_activebooleanПо умолчанию: false
organization_idstring
cashbacksobject[]
cashbacks[].cashback_typestringДопустимые значения: percent, cash
cashbacks[].min_amountnumber
cashbacks[].amountnumber
cashbacks[].percentnumber
cashbacks[].currency_idstring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "type": "all",
    "is_active": false,
    "organization_id": "string",
    "cashbacks": [
      {
        "cashback_type": "percent",
        "min_amount": 0,
        "amount": 0,
        "percent": 0,
        "currency_id": "67b486d242ed76693cd2cc59"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /cashback-setting/update ​

This method allows updating cashback-settings in the account.

Нужное разрешение: cashback · как работают разрешения

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

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

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/cashback-setting/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "type": "by_amount",
        "is_active": True,
        "organization_id": "67b486d242ed76693cd2cc59",
        "_id": "63f8b0c4e4b0d3a2f8e4b0c4",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "type": "by_amount",
  "is_active": true,
  "organization_id": "67b486d242ed76693cd2cc59",
  "_id": "63f8b0c4e4b0d3a2f8e4b0c4"
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
typestringДаДопустимые значения: by_amount, all. По умолчанию: "by_amount"
is_activebooleanДаПо умолчанию: true
organization_idstringДа
organization_idsstring[]Нет
cashbacksobject[]НетRequired when type is by_amount.
cashbacks[].cashback_typestringДаДопустимые значения: percent, cash. По умолчанию: "percent"
cashbacks[].min_amountnumberНет
cashbacks[].amountnumberДа
cashbacks[].currency_idstringНетRequired when cashback_type is cash.
cashbacks[].is_all_categoriesbooleanНетПо умолчанию: false
cashbacks[].category_idsstring[]Нет
cashbacks[].item_added_idsstring[]Нет
json
{
  "_id": "63f8b0c4e4b0d3a2f8e4b0c4",
  "type": "by_amount",
  "is_active": true,
  "organization_id": "67b486d242ed76693cd2cc59",
  "organization_ids": [
    "63f8b0c4e4b0d3a2f8e4b0c4"
  ],
  "cashbacks": [
    {
      "cashback_type": "percent",
      "min_amount": 0,
      "amount": 0,
      "currency_id": "67b486d242ed76693cd2cc59",
      "is_all_categories": false,
      "category_ids": [],
      "item_added_ids": []
    }
  ]
}

Ответ

Структура ответа совпадает с POST /cashback-setting/create.

DELETE /cashback-setting/delete/{id} ​

Delete a cashback-settings

Нужное разрешение: cashback · как работают разрешения

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

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

Параметры пути

ПараметрТипОбязательноОписание
idstringДа

Тело запроса

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

Ответ

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

GET /cashback-setting/get-all ​

Get all cashback-settings

Нужное разрешение: cashback · как работают разрешения

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

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

Тело запроса

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

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "type": "all",
      "is_active": false,
      "organization_id": "string",
      "cashbacks": [
        {
          "cashback_type": null,
          "min_amount": null,
          "amount": null,
          "percent": null,
          "currency_id": null
        }
      ]
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}

GET /cashback-setting/get-by-id/{id} ​

Get cashback-settings using its _id

Нужное разрешение: cashback · как работают разрешения

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

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

Параметры пути

ПараметрТипОбязательноОписание
idstringДа

Тело запроса

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

Ответ

Структура ответа совпадает с POST /cashback-setting/create.

GET /cashback-setting/get-deleted ​

Get deleted cashback-settings ids

Нужное разрешение: cashback · как работают разрешения

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

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/cashback-setting/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/cashback-setting/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/cashback-setting/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/cashback-setting/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);

Параметры запроса

ПараметрТипОбязательноОписание
deleted_atstringДа

Тело запроса

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

Ответ

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

GET /cashback-setting/get-by-organization_id/{organization_id} ​

Get cashback-settings using organization_id

Нужное разрешение: cashback · как работают разрешения

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

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

Параметры пути

ПараметрТипОбязательноОписание
organization_idstringДаorganization_id

Тело запроса

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

Ответ

Структура ответа совпадает с POST /cashback-setting/create.


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

Bito 2.0 Integration API