# Transaction

::: 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 /transaction/income

This method allows adding transaction into the account.

**Required permission:** `cash_income` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/transaction/income' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/income', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "amount": 10,
    "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
    "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
    "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/income",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "amount": 10,
        "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
        "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
        "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `invoice_id` | `string` | No |  |
| `payment_type_id` | `string` | No | Required unless `invoice_id` is sent. |
| `employee_id` | `string` | No | Required when `user_type` is `employee` and `invoice_id` is not sent. |
| `employee_assistant_id` | `string` | No |  |
| `supplier_id` | `string` | No | Required when `user_type` is `supplier` and `invoice_id` is not sent. |
| `supplier_assistant_id` | `string` | No |  |
| `customer_id` | `string` | No | Required when `user_type` is `customer` and `invoice_id` is not sent. |
| `customer_assistant_id` | `string` | No |  |
| `person_id` | `string` | No | Required when `user_type` is `person` and `invoice_id` is not sent. |
| `person_assistant_id` | `string` | No |  |
| `user_type` | `string` | No | When `invoice_id` is not sent, the server takes this from the payment type and ignores the value sent.. One of: `supplier`, `employee`, `customer`, `person`, `other` |
| `amount` | `number` | Yes | Default: `10` |
| `paid` | `number` | No | Default: `10` |
| `payment_method_id` | `string` | Yes |  |
| `currency_id` | `string` | Yes |  |
| `cashbox_id` | `string` | Yes | Cashbox ObjectId. |
| `description` | `string` | No |  |
| `month` | `string (date-time)` | No |  |
| `exchange_balance` | `boolean` | No |  |
| `commission_rate` | `number` | No |  |

```json
{
  "invoice_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "payment_type_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "employee_id": "64b7f4d9e2b3b6a0b7c5d800",
  "employee_assistant_id": "64b7f4d9e2b3b6a0b7c5d801",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d802",
  "supplier_assistant_id": "64b7f4d9e2b3b6a0b7c5d803",
  "customer_id": "64b7f4d9e2b3b6a0b7c5d804",
  "customer_assistant_id": "64b7f4d9e2b3b6a0b7c5d805",
  "person_id": "64b7f4d9e2b3b6a0b7c5d806",
  "person_assistant_id": "64b7f4d9e2b3b6a0b7c5d807",
  "user_type": "customer",
  "amount": 10,
  "paid": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "description": "string",
  "month": "2025-05-01T12:00:00Z",
  "exchange_balance": false,
  "commission_rate": 0
}
```

**Response**

| Field | Type | Description |
|---|---|---|
| `number` | `string` | Transaction number |
| `type` | `string` | Transaction type |
| `balance_changes` | `object[]` | Balance changes |
| `balance_changes[].currency_id` | `string` | Currency ID |
| `balance_changes[].amount` | `number` | Amount |
| `balance_changes[].value` | `number` | Value |
| `balance_changes[].user_type` | `string` | User type |
| `organization` | `object` | Organization |
| `organization._id` | `string` | Organization ID |
| `organization.name` | `string` | Organization name |
| `payment_type` | `object` | Payment type |
| `payment_type._id` | `string` | Payment type ID |
| `payment_type.name` | `string` | Payment type name |
| `payment_type.payment_type` | `string` | Payment type |
| `contract_number` | `string` | Contract number |
| `amount` | `number` | Amount |
| `state` | `string` | State |
| `currency_id` | `string` | Currency ID |
| `exchange_amount` | `number` | Exchange amount |
| `cashbox_id` | `string` | Cashbox ID |
| `cashbox` | `object` | Cashbox |
| `cashbox._id` | `string` | Cashbox ID |
| `cashbox.name` | `string` | Cashbox name |
| `destination_cashbox_id` | `string` | Destination cashbox ID |
| `destination_cashbox` | `object` | Destination cashbox |
| `destination_cashbox._id` | `string` | Destination cashbox ID |
| `destination_cashbox.name` | `string` | Destination cashbox name |
| `source_cashbox_id` | `string` | Source cashbox ID |
| `source_cashbox` | `object` | Source cashbox |
| `source_cashbox._id` | `string` | Source cashbox ID |
| `source_cashbox.name` | `string` | Source cashbox name |
| `exchange_currency` | `object` | Exchange currency |
| `exchange_currency._id` | `string` | Exchange currency ID |
| `exchange_currency.name` | `string` | Exchange currency name |
| `exchange_currency.value` | `number` | Exchange currency value |
| `employee` | `object` | Employee |
| `employee._id` | `string` | Employee ID |
| `employee.full_name` | `string` | Employee full name |
| `employee.phone_number` | `string` | Employee phone number |
| `supplier` | `object` | Supplier |
| `supplier._id` | `string` | Supplier ID |
| `supplier.full_name` | `string` | Supplier full name |
| `supplier.name` | `string` | Supplier name |
| `supplier.phone_number` | `string` | Supplier phone number |
| `customer` | `object` | Customer |
| `customer._id` | `string` | Customer ID |
| `customer.full_name` | `string` | Customer full name |
| `customer.name` | `string` | Customer name |
| `customer.phone_number` | `string` | Customer phone number |
| `person` | `object` | Person |
| `person._id` | `string` | Person ID |
| `person.name` | `string` | Person name |
| `person.full_name` | `string` | Person full name |
| `person.phone_number` | `string` | Person phone number |
| `person.type` | `string` | Person type |
| `parent` | `object` | Parent |
| `parent._id` | `string` | Parent ID |
| `parent.amount` | `number` | Amount |
| `parent.currency_id` | `string` | Currency ID |
| `parent.payment_method_id` | `string` | Payment method ID |
| `parent.payment_method` | `string` | Payment method |
| `parent.cashbox_id` | `string` | Cashbox ID |
| `parent.type` | `string` | Type |
| `parent.custom_id` | `string` | Custom ID |
| `destination` | `object` | Destination |
| `destination._id` | `string` | Destination ID |
| `destination.name` | `string` | Name |
| `payment_method` | `object` | Payment method |
| `payment_method._id` | `string` | Payment method ID |
| `payment_method.type` | `string` | Type |
| `payment_method.name` | `string` | Name |
| `created_at` | `string` | Created at |
| `date` | `string` | Date |
| `updated_at` | `string` | Updated at |
| `is_deleted` | `boolean` | Is deleted |
| `completely_deleted` | `boolean` | Completely deleted |
| `balance_list` | `object[]` | Balance list |
| `created_by` | `object` | Created by |
| `created_by._id` | `string` | Created by ID |
| `created_by.full_name` | `string` | Full name |
| `to_customer` | `string` | To customer |
| `to_supplier` | `string` | To supplier |
| `to_employee` | `string` | To employee |
| `to_person` | `string` | To person |
| `description` | `string` | Description |
| `receipt` | `string` | Receipt |
| `cashbox_before_balance` | `object` | Cashbox before balance |
| `cashbox_before_balance._id` | `string` |  |
| `cashbox_before_balance.organization_id` | `integer` | Organization ID |
| `cashbox_before_balance.payment_method_id` | `string` | Payment method ID |
| `cashbox_before_balance.currency_id` | `string` | Currency ID |
| `cashbox_before_balance.amount` | `number` |  |
| `cashbox_after_balance` | `object` | Cashbox after balance |
| `cashbox_after_balance._id` | `string` |  |
| `cashbox_after_balance.organization_id` | `integer` | Organization ID |
| `cashbox_after_balance.payment_method_id` | `string` | Payment method ID |
| `cashbox_after_balance.currency_id` | `string` | Currency ID |
| `cashbox_after_balance.amount` | `number` |  |
| `human_before_balance` | `object` | Human before balance |
| `human_before_balance._id` | `string` |  |
| `human_before_balance.organization_id` | `integer` | Organization ID |
| `human_before_balance.payment_method_id` | `string` | Payment method ID |
| `human_before_balance.currency_id` | `string` | Currency ID |
| `human_before_balance.amount` | `number` |  |
| `human_after_balance` | `object` | Human after balance |
| `human_after_balance._id` | `string` |  |
| `human_after_balance.organization_id` | `integer` | Organization ID |
| `human_after_balance.payment_method_id` | `string` | Payment method ID |
| `human_after_balance.currency_id` | `string` | Currency ID |
| `human_after_balance.amount` | `number` |  |
| `attachments` | `string[]` | Attachments |
| `invoice` | `object` | Invoice |
| `invoice._id` | `string` | Invoice ID |
| `invoice.number` | `string` | Invoice number |
| `invoice.currency_id` | `string` | Currency ID |
| `invoice.currency_value` | `number` | Currency value |
| `invoice.paid` | `number` | Paid amount |
| `invoice.main_id` | `string` | Main invoice ID |
| `can_be_canceled` | `boolean` | Can be canceled |
| `done_at` | `string` | Done at |
| `rejected_at` | `string` | Rejected at |
| `canceled_at` | `string` | Canceled at |
| `device` | `object` | Device |
| `device._id` | `string` | Device ID |
| `device.name` | `string` | Device name |
| `device.device_id` | `string` | Device ID |
| `trade` | `object` | Trade |
| `trade._id` | `string` | Trade ID |
| `trade.number` | `string` | Trade number |
| `trade.is_refund` | `string` | Is refund |
| `responsible` | `object` | Responsible |
| `responsible._id` | `string` | Responsible ID |
| `responsible.full_name` | `string` | Full name |
| `customer_assistant` | `object` | Customer assistant |
| `customer_assistant._id` | `string` | Customer assistant ID |
| `customer_assistant.name` | `string` | Customer assistant name |
| `customer_assistant.type` | `string` | Customer assistant type |
| `supplier_assistant` | `object` | Supplier assistant |
| `supplier_assistant._id` | `string` | Supplier assistant ID |
| `supplier_assistant.name` | `string` | Supplier assistant name |
| `supplier_assistant.type` | `string` | Supplier assistant type |
| `employee_assistant` | `object` | Employee assistant |
| `employee_assistant._id` | `string` | Employee assistant ID |
| `employee_assistant.name` | `string` | Employee assistant name |
| `employee_assistant.type` | `string` | Employee assistant type |
| `person_assistant` | `object` | Person assistant |
| `person_assistant._id` | `string` | Person assistant ID |
| `person_assistant.name` | `string` | Person assistant name |
| `person_assistant.type` | `string` | Person assistant type |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "number": "string",
    "type": "string",
    "balance_changes": [
      {
        "currency_id": "string",
        "amount": 0,
        "value": 0,
        "user_type": "string"
      }
    ],
    "organization": {
      "_id": "string",
      "name": "string"
    },
    "payment_type": {
      "_id": "string",
      "name": "string",
      "payment_type": "string"
    },
    "contract_number": "string",
    "amount": 0,
    "state": "string",
    "currency_id": "string",
    "exchange_amount": 0,
    "cashbox_id": "string",
    "cashbox": {
      "_id": "string",
      "name": "string"
    },
    "destination_cashbox_id": "string",
    "destination_cashbox": {
      "_id": "string",
      "name": "string"
    },
    "source_cashbox_id": "string",
    "source_cashbox": {
      "_id": "string",
      "name": "string"
    },
    "exchange_currency": {
      "_id": "string",
      "name": "string",
      "value": 0
    },
    "employee": {
      "_id": "string",
      "full_name": "string",
      "phone_number": "string"
    },
    "supplier": {
      "_id": "string",
      "full_name": "string",
      "name": "string",
      "phone_number": "string"
    },
    "customer": {
      "_id": "string",
      "full_name": "string",
      "name": "string",
      "phone_number": "string"
    },
    "person": {
      "_id": "string",
      "name": "string",
      "full_name": "string",
      "phone_number": "string",
      "type": "string"
    },
    "parent": {
      "_id": "string",
      "amount": 0,
      "currency_id": "string",
      "payment_method_id": "string",
      "payment_method": "string",
      "cashbox_id": "string",
      "type": "string",
      "custom_id": "string"
    },
    "destination": {
      "_id": "string",
      "name": "string"
    },
    "payment_method": {
      "_id": "string",
      "type": "string",
      "name": "string"
    },
    "created_at": "string",
    "date": "string",
    "updated_at": "string",
    "is_deleted": false,
    "completely_deleted": false,
    "balance_list": [
      {}
    ],
    "created_by": {
      "_id": "string",
      "full_name": "string"
    },
    "to_customer": "string",
    "to_supplier": "string",
    "to_employee": "string",
    "to_person": "string",
    "description": "string",
    "receipt": "string",
    "cashbox_before_balance": {
      "_id": "string",
      "organization_id": 0,
      "payment_method_id": "string",
      "currency_id": "string",
      "amount": 0
    },
    "cashbox_after_balance": {
      "_id": "string",
      "organization_id": 0,
      "payment_method_id": "string",
      "currency_id": "string",
      "amount": 0
    },
    "human_before_balance": {
      "_id": "string",
      "organization_id": 0,
      "payment_method_id": "string",
      "currency_id": "string",
      "amount": 0
    },
    "human_after_balance": {
      "_id": "string",
      "organization_id": 0,
      "payment_method_id": "string",
      "currency_id": "string",
      "amount": 0
    },
    "attachments": [
      "string"
    ],
    "invoice": {
      "_id": "string",
      "number": "string",
      "currency_id": "string",
      "currency_value": 0,
      "paid": 0,
      "main_id": "string"
    },
    "can_be_canceled": false,
    "done_at": "string",
    "rejected_at": "string",
    "canceled_at": "string",
    "device": {
      "_id": "string",
      "name": "string",
      "device_id": "string"
    },
    "trade": {
      "_id": "string",
      "number": "string",
      "is_refund": "string"
    },
    "responsible": {
      "_id": "string",
      "full_name": "string"
    },
    "customer_assistant": {
      "_id": "string",
      "name": "string",
      "type": "string"
    },
    "supplier_assistant": {
      "_id": "string",
      "name": "string",
      "type": "string"
    },
    "employee_assistant": {
      "_id": "string",
      "name": "string",
      "type": "string"
    },
    "person_assistant": {
      "_id": "string",
      "name": "string",
      "type": "string"
    }
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /transaction/expense

This method allows adding transaction into the account.

**Required permission:** `cash_expense` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/transaction/expense' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/expense', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "amount": 10,
    "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
    "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
    "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/expense",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "amount": 10,
        "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
        "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
        "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `invoice_id` | `string` | No |  |
| `payment_type_id` | `string` | No | Required unless `invoice_id` is sent. |
| `employee_id` | `string` | No | Required when `user_type` is `employee` and `invoice_id` is not sent. |
| `employee_assistant_id` | `string` | No |  |
| `supplier_id` | `string` | No | Required when `user_type` is `supplier` and `invoice_id` is not sent. |
| `supplier_assistant_id` | `string` | No |  |
| `customer_id` | `string` | No | Required when `user_type` is `customer` and `invoice_id` is not sent. |
| `customer_assistant_id` | `string` | No |  |
| `person_id` | `string` | No | Required when `user_type` is `person` and `invoice_id` is not sent. |
| `person_assistant_id` | `string` | No |  |
| `user_type` | `string` | No | When `invoice_id` is not sent, the server takes this from the payment type and ignores the value sent.. One of: `supplier`, `employee`, `customer`, `person`, `other` |
| `amount` | `number` | Yes | Default: `10` |
| `paid` | `number` | No | Default: `10` |
| `payment_method_id` | `string` | Yes |  |
| `currency_id` | `string` | Yes |  |
| `cashbox_id` | `string` | Yes | Cashbox ObjectId. |
| `description` | `string` | No |  |
| `month` | `string (date-time)` | No |  |
| `exchange_balance` | `boolean` | No |  |
| `commission_rate` | `number` | No |  |

```json
{
  "invoice_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "payment_type_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "employee_id": "64b7f4d9e2b3b6a0b7c5d800",
  "employee_assistant_id": "64b7f4d9e2b3b6a0b7c5d801",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d802",
  "supplier_assistant_id": "64b7f4d9e2b3b6a0b7c5d803",
  "customer_id": "64b7f4d9e2b3b6a0b7c5d804",
  "customer_assistant_id": "64b7f4d9e2b3b6a0b7c5d805",
  "person_id": "64b7f4d9e2b3b6a0b7c5d806",
  "person_assistant_id": "64b7f4d9e2b3b6a0b7c5d807",
  "user_type": "customer",
  "amount": 10,
  "paid": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "description": "string",
  "month": "2025-05-01T12:00:00Z",
  "exchange_balance": false,
  "commission_rate": 0
}
```

**Response**

Same response shape as [POST /transaction/income](#post-transaction-income).

## POST /transaction/transfer

This method allows adding transaction into the account.

**Required permission:** `cash_transfer` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/transaction/transfer' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/transfer', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "amount": 10,
    "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
    "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
    "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/transfer",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "amount": 10,
        "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
        "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
        "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `destination_cashbox_id` | `string` | Yes |  |
| `user_type` | `string` | No | One of: `supplier`, `employee`, `customer`, `person`, `other` |
| `amount` | `number` | Yes | Default: `10` |
| `paid` | `number` | No | Default: `10` |
| `payment_method_id` | `string` | Yes |  |
| `currency_id` | `string` | Yes |  |
| `cashbox_id` | `string` | Yes | Cashbox ObjectId. |
| `description` | `string` | No |  |
| `month` | `string (date-time)` | No |  |
| `exchange_balance` | `boolean` | No |  |
| `commission_rate` | `number` | No |  |

```json
{
  "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "user_type": "customer",
  "amount": 10,
  "paid": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "description": "string",
  "month": "2025-05-01T12:00:00Z",
  "exchange_balance": false,
  "commission_rate": 0
}
```

**Response**

Same response shape as [POST /transaction/income](#post-transaction-income).

## POST /transaction/exchange

This method allows adding transaction into the account.

**Required permission:** `cash_exchange` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/transaction/exchange' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "exchange_currency_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "exchange_amount": 10,
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/exchange', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "exchange_currency_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "exchange_amount": 10,
    "amount": 10,
    "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
    "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
    "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/exchange",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "exchange_currency_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "exchange_amount": 10,
        "amount": 10,
        "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
        "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
        "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "exchange_currency_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "exchange_amount": 10,
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `exchange_currency_id` | `string` | Yes |  |
| `exchange_amount` | `number` | Yes | Default: `10` |
| `destination_cashbox_id` | `string` | Yes |  |
| `user_type` | `string` | No | One of: `supplier`, `employee`, `customer`, `person`, `other` |
| `amount` | `number` | Yes | Default: `10` |
| `paid` | `number` | No | Default: `10` |
| `payment_method_id` | `string` | Yes |  |
| `currency_id` | `string` | Yes |  |
| `cashbox_id` | `string` | Yes | Cashbox ObjectId. |
| `description` | `string` | No |  |
| `month` | `string (date-time)` | No |  |
| `exchange_balance` | `boolean` | No |  |
| `commission_rate` | `number` | No |  |

```json
{
  "exchange_currency_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "exchange_amount": 10,
  "destination_cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "user_type": "customer",
  "amount": 10,
  "paid": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "description": "string",
  "month": "2025-05-01T12:00:00Z",
  "exchange_balance": false,
  "commission_rate": 0
}
```

**Response**

Same response shape as [POST /transaction/income](#post-transaction-income).

## POST /transaction/exchange-method

This method allows adding transaction into the account.

**Required permission:** `cash_exchange_method` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/transaction/exchange-method' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "destination_payment_method_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "exchange_amount": 10,
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/exchange-method', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "destination_payment_method_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "exchange_amount": 10,
    "amount": 10,
    "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
    "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
    "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/exchange-method",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "destination_payment_method_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "exchange_amount": 10,
        "amount": 10,
        "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
        "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
        "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "destination_payment_method_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "exchange_amount": 10,
  "amount": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `destination_payment_method_id` | `string` | Yes |  |
| `exchange_amount` | `number` | Yes | Default: `10` |
| `user_type` | `string` | No | One of: `supplier`, `employee`, `customer`, `person`, `other` |
| `amount` | `number` | Yes | Default: `10` |
| `paid` | `number` | No | Default: `10` |
| `payment_method_id` | `string` | Yes |  |
| `currency_id` | `string` | Yes |  |
| `cashbox_id` | `string` | Yes | Cashbox ObjectId. |
| `description` | `string` | No |  |
| `month` | `string (date-time)` | No |  |
| `exchange_balance` | `boolean` | No |  |
| `commission_rate` | `number` | No |  |

```json
{
  "destination_payment_method_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "exchange_amount": 10,
  "user_type": "customer",
  "amount": 10,
  "paid": 10,
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d806",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d806",
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "description": "string",
  "month": "2025-05-01T12:00:00Z",
  "exchange_balance": false,
  "commission_rate": 0
}
```

**Response**

Same response shape as [POST /transaction/income](#post-transaction-income).

## PUT /transaction/set-state

This method allows setting transaction state.

**Required permission:** `transactions` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

An app that cancels documents should request `transaction_cancel` as well.

**Example request**

::: code-group

```bash [curl]
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/transaction/set-state' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "state": "pending",
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/set-state', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "state": "pending",
    "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/set-state",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "state": "pending",
        "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "state": "pending",
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `_id` | `string` | Yes |  |
| `state` | `string` | Yes | One of: `canceled`, `pending`, `done`, `rejected` |
| `cancel_related_transaction` | `boolean` | No | Default: `false` |

```json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "state": "pending",
  "cancel_related_transaction": false
}
```

**Response**

Same response shape as [POST /transaction/income](#post-transaction-income).

## PUT /transaction/expense/approve

Approve a pending expense transaction.

**Required permission:** `cash_expense_approve` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/transaction/expense/approve' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/expense/approve', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/expense/approve",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `_id` | `string` | Yes | Expense transaction ObjectId to approve |

```json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
```

**Response**

Same response shape as [POST /transaction/income](#post-transaction-income).

## PUT /transaction/expense/reject

Reject a pending expense transaction with a reason.

**Required permission:** `cash_expense_approve` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/transaction/expense/reject' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "approval_rejected_reason": "string"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/expense/reject', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "approval_rejected_reason": "string"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/expense/reject",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "approval_rejected_reason": "string",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "approval_rejected_reason": "string"
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `_id` | `string` | Yes | Expense transaction ObjectId to reject |
| `approval_rejected_reason` | `string` | Yes | Reason for rejecting the expense (at least 10 characters) |

```json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "approval_rejected_reason": "string"
}
```

**Response**

Same response shape as [POST /transaction/income](#post-transaction-income).

## PUT /transaction/expense/redirect

Redirect a pending expense transaction to another approver.

**Required permission:** `transactions` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/transaction/expense/redirect' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "approver_id": "64b7f4d9e2b3b6a0b7c5d800"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/expense/redirect', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "approver_id": "64b7f4d9e2b3b6a0b7c5d800"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/expense/redirect",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "approver_id": "64b7f4d9e2b3b6a0b7c5d800",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "approver_id": "64b7f4d9e2b3b6a0b7c5d800"
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `_id` | `string` | Yes | Expense transaction ObjectId to redirect |
| `approver_id` | `string` | Yes | Employee ObjectId of the new approver |
| `approval_redirect_comment` | `string` | No | Optional comment explaining the redirect |

```json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "approver_id": "64b7f4d9e2b3b6a0b7c5d800",
  "approval_redirect_comment": "string"
}
```

**Response**

Same response shape as [POST /transaction/income](#post-transaction-income).

## GET /transaction/get-by-id/{id}

Get transaction using its _id

**Required permission:** `transactions` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/transaction/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/get-by-id/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/get-by-id/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/transaction/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**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | Yes |  |

**Request body**

No request body.

**Response**

Same response shape as [POST /transaction/income](#post-transaction-income).

## POST /transaction/get-paging

Get transactions by paging

**Required permission:** `transactions` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/transaction/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/transaction/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 [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/transaction/get-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

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

| Field | Type | Required | Description |
|---|---|---|---|
| `page` | `number` | Yes | Default: `1` |
| `limit` | `number` | Yes | Default: `20` |
| `type` | `string` | No |  |
| `states` | `string[]` | No |  |
| `payment_type_id` | `string` | No |  |
| `payment_type_ids` | `string[]` | No |  |
| `sort_by` | `string` | No |  |
| `date_from` | `string` | No |  |
| `date_to` | `string` | No |  |
| `payment_method_id` | `string` | No |  |
| `payment_method_ids` | `string[]` | No |  |
| `cashbox_id` | `string` | No |  |
| `organization_id` | `string` | No |  |
| `customer_id` | `string` | No |  |
| `supplier_id` | `string` | No |  |
| `person_id` | `string` | No |  |
| `employee_id` | `string` | No |  |
| `is_deleted` | `boolean` | No |  |
| `employee_ids` | `string[]` | No |  |
| `currency_id` | `string` | No |  |
| `updated_at` | `string (date-time)` | No | Only records updated at or after this time. |

```json
{
  "page": 1,
  "limit": 20,
  "type": "income",
  "states": [
    "pending"
  ],
  "payment_type_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "payment_type_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "sort_by": "created_at",
  "date_from": "2023-07-20T12:34:56.789Z",
  "date_to": "2023-07-21T12:34:56.789Z",
  "payment_method_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "payment_method_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "cashbox_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "person_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "employee_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "is_deleted": true,
  "employee_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "currency_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "updated_at": "2025-05-01T12:00:00Z"
}
```

**Response**

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

| Field | Type | Description |
|---|---|---|
| `number` | `string` | Transaction number |
| `type` | `string` | Transaction type |
| `balance_changes` | `object[]` | Balance changes |
| `balance_changes[].currency_id` | `string` | Currency ID |
| `balance_changes[].amount` | `number` | Amount |
| `balance_changes[].value` | `number` | Value |
| `balance_changes[].user_type` | `string` | User type |
| `organization_id` | `string` | Organization ID |
| `payment_type` | `object` | Payment type |
| `payment_type._id` | `string` | Payment type ID |
| `payment_type.name` | `string` | Payment type name |
| `payment_type.payment_type` | `string` | Payment type |
| `contract_number` | `string` | Contract number |
| `amount` | `number` | Amount |
| `state` | `string` | State |
| `currency` | `object` | Currency |
| `currency._id` | `string` | Currency ID |
| `currency.name` | `string` | Currency name |
| `currency.value` | `number` | Currency value |
| `exchange_amount` | `number` | Exchange amount |
| `cashbox_id` | `string` | Cashbox ID |
| `destination_cashbox_id` | `string` | Destination cashbox ID |
| `exchange_currency` | `object` | Exchange currency |
| `exchange_currency._id` | `string` | Exchange currency ID |
| `exchange_currency.name` | `string` | Exchange currency name |
| `exchange_currency.value` | `number` | Exchange currency value |
| `employee` | `object` | Employee |
| `employee._id` | `string` | Employee ID |
| `employee.full_name` | `string` | Employee full name |
| `employee.phone_number` | `string` | Employee phone number |
| `supplier` | `object` | Supplier |
| `supplier._id` | `string` | Supplier ID |
| `supplier.full_name` | `string` | Supplier full name |
| `supplier.name` | `string` | Supplier name |
| `supplier.phone_number` | `string` | Supplier phone number |
| `customer` | `object` | Customer |
| `customer._id` | `string` | Customer ID |
| `customer.full_name` | `string` | Customer full name |
| `customer.name` | `string` | Customer name |
| `customer.phone_number` | `string` | Customer phone number |
| `person` | `object` | Person |
| `person._id` | `string` | Person ID |
| `person.name` | `string` | Person name |
| `person.full_name` | `string` | Person full name |
| `person.phone_number` | `string` | Person phone number |
| `person.type` | `string` | Person type |
| `parent` | `object` | Parent |
| `parent._id` | `string` | Parent ID |
| `parent.amount` | `number` | Amount |
| `parent.currency_id` | `string` | Currency ID |
| `parent.payment_method_id` | `string` | Payment method ID |
| `parent.payment_method` | `string` | Payment method |
| `parent.cashbox_id` | `string` | Cashbox ID |
| `parent.type` | `string` | Type |
| `parent.custom_id` | `string` | Custom ID |
| `destination` | `object` | Destination |
| `destination._id` | `string` | Destination ID |
| `destination.name` | `string` | Name |
| `payment_method` | `object` | Payment method |
| `payment_method._id` | `string` | Payment method ID |
| `payment_method.type` | `string` | Type |
| `payment_method.name` | `string` | Name |
| `created_at` | `string` | Created at |
| `date` | `string` | Date |
| `updated_at` | `string` | Updated at |
| `is_deleted` | `boolean` | Is deleted |
| `completely_deleted` | `boolean` | Completely deleted |
| `balance_list` | `object[]` | Balance list |
| `created_by` | `object` | Created by |
| `created_by._id` | `string` | Created by ID |
| `created_by.full_name` | `string` | Full name |
| `description` | `string` | Description |
| `receipt` | `string` | Receipt |
| `cashbox_before_balance` | `object` | Cashbox before balance |
| `cashbox_before_balance._id` | `string` |  |
| `cashbox_before_balance.organization_id` | `integer` | Organization ID |
| `cashbox_before_balance.payment_method_id` | `string` | Payment method ID |
| `cashbox_before_balance.currency_id` | `string` | Currency ID |
| `cashbox_before_balance.amount` | `number` |  |
| `cashbox_after_balance` | `object` | Cashbox after balance |
| `cashbox_after_balance._id` | `string` |  |
| `cashbox_after_balance.organization_id` | `integer` | Organization ID |
| `cashbox_after_balance.payment_method_id` | `string` | Payment method ID |
| `cashbox_after_balance.currency_id` | `string` | Currency ID |
| `cashbox_after_balance.amount` | `number` |  |
| `human_before_balance` | `object` | Human before balance |
| `human_before_balance._id` | `string` |  |
| `human_before_balance.organization_id` | `integer` | Organization ID |
| `human_before_balance.payment_method_id` | `string` | Payment method ID |
| `human_before_balance.currency_id` | `string` | Currency ID |
| `human_before_balance.amount` | `number` |  |
| `human_after_balance` | `object` | Human after balance |
| `human_after_balance._id` | `string` |  |
| `human_after_balance.organization_id` | `integer` | Organization ID |
| `human_after_balance.payment_method_id` | `string` | Payment method ID |
| `human_after_balance.currency_id` | `string` | Currency ID |
| `human_after_balance.amount` | `number` |  |
| `attachments` | `string[]` | Attachments |
| `invoice` | `object` | Invoice |
| `invoice._id` | `string` | Invoice ID |
| `invoice.number` | `string` | Invoice number |
| `invoice.currency_id` | `string` | Currency ID |
| `invoice.currency_value` | `number` | Currency value |
| `invoice.paid` | `number` | Paid amount |
| `invoice.main_id` | `string` | Main invoice ID |
| `can_be_canceled` | `boolean` | Can be canceled |
| `amount_in_main` | `number` | Amount in main currency |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "number": "string",
        "type": "string",
        "balance_changes": [
          {
            "currency_id": "string",
            "amount": 0,
            "value": 0,
            "user_type": "string"
          }
        ],
        "organization_id": "string",
        "payment_type": {
          "_id": "string",
          "name": "string",
          "payment_type": "string"
        },
        "contract_number": "string",
        "amount": 0,
        "state": "string",
        "currency": {
          "_id": "string",
          "name": "string",
          "value": 0
        },
        "exchange_amount": 0,
        "cashbox_id": "string",
        "destination_cashbox_id": "string",
        "exchange_currency": {
          "_id": "string",
          "name": "string",
          "value": 0
        },
        "employee": {
          "_id": "string",
          "full_name": "string",
          "phone_number": "string"
        },
        "supplier": {
          "_id": "string",
          "full_name": "string",
          "name": "string",
          "phone_number": "string"
        },
        "customer": {
          "_id": "string",
          "full_name": "string",
          "name": "string",
          "phone_number": "string"
        },
        "person": {
          "_id": "string",
          "name": "string",
          "full_name": "string",
          "phone_number": "string",
          "type": "string"
        },
        "parent": {
          "_id": "string",
          "amount": 0,
          "currency_id": "string",
          "payment_method_id": "string",
          "payment_method": "string",
          "cashbox_id": "string",
          "type": "string",
          "custom_id": "string"
        },
        "destination": {
          "_id": "string",
          "name": "string"
        },
        "payment_method": {
          "_id": "string",
          "type": "string",
          "name": "string"
        },
        "created_at": "string",
        "date": "string",
        "updated_at": "string",
        "is_deleted": false,
        "completely_deleted": false,
        "balance_list": [
          {}
        ],
        "created_by": {
          "_id": "string",
          "full_name": "string"
        },
        "description": "string",
        "receipt": "string",
        "cashbox_before_balance": {
          "_id": "string",
          "organization_id": 0,
          "payment_method_id": "string",
          "currency_id": "string",
          "amount": 0
        },
        "cashbox_after_balance": {
          "_id": "string",
          "organization_id": 0,
          "payment_method_id": "string",
          "currency_id": "string",
          "amount": 0
        },
        "human_before_balance": {
          "_id": "string",
          "organization_id": 0,
          "payment_method_id": "string",
          "currency_id": "string",
          "amount": 0
        },
        "human_after_balance": {
          "_id": "string",
          "organization_id": 0,
          "payment_method_id": "string",
          "currency_id": "string",
          "amount": 0
        },
        "attachments": [
          "string"
        ],
        "invoice": {
          "_id": "string",
          "number": "string",
          "currency_id": "string",
          "currency_value": 0,
          "paid": 0,
          "main_id": "string"
        },
        "can_be_canceled": false,
        "amount_in_main": 0
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}
```

---

*This page is generated from the OpenAPI spec.*
