Purchase return
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 /purchase-return/get-paging
Paginated list of purchase returns with optional filters.
Required permission: purchase_return · how permissions work
Example request
bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/purchase-return/get-paging' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"page": 1,
"limit": 20
}'js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/purchase-return/get-paging', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"page": 1,
"limit": 20
}),
})
const { code, data } = await res.json()python
import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/purchase-return/get-paging",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"page": 1,
"limit": 20,
},
)
print(res.json())php
<?php
$body = <<<'JSON'
{
"page": 1,
"limit": 20
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/purchase-return/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 |
states | string[] | No | |
organization_id | string | No | |
supplier_id | string | No | |
responsible_id | string | No | |
date_from | string (date-time) | No | |
date_to | string (date-time) | No | |
search | string | No | Free-text search. |
updated_at | string (date-time) | No | Only records updated at or after this time. |
sort_by | string | No | Field name to sort by. |
asc | integer | No | Sort direction: 1 ascending, -1 descending.. One of: -1, 1 |
json
{
"page": 1,
"limit": 20,
"states": [
"new"
],
"organization_id": "string",
"supplier_id": "string",
"responsible_id": "string",
"date_from": "2025-05-01T12:00:00Z",
"date_to": "2025-05-01T12:00:00Z",
"search": "string",
"updated_at": "2025-05-01T12:00:00Z",
"sort_by": "string",
"asc": -1
}Response
| Field | Type | Description |
|---|---|---|
list | any[] | |
total | number |
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"list": [],
"total": 0
},
"time": "2025-05-01T12:00:00Z"
}GET /purchase-return/get-by-id/{id}
Get a purchase return by its _id (detailed view).
Required permission: purchase_return · how permissions work
Example request
bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/purchase-return/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/purchase-return/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/purchase-return/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/purchase-return/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
| Field | Type | Description |
|---|---|---|
_id | string | |
number | string | |
organization_id | string | |
supplier_id | string | |
purchase_id | string | |
responsible_id | string | |
warehouse_id | string | |
currency_id | string | |
date | string (date-time) | |
state | string | One of: new, done, canceled |
total | number | |
note | string | |
items | object[] | |
items[]._id | string | |
items[].product_id | string | |
items[].amount | number | |
items[].cost | number | |
created_at | string (date-time) | |
updated_at | string (date-time) |
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"number": "string",
"organization_id": "string",
"supplier_id": "string",
"purchase_id": "string",
"responsible_id": "string",
"warehouse_id": "string",
"currency_id": "string",
"date": "2025-05-01T12:00:00Z",
"state": "new",
"total": 0,
"note": "string",
"items": [
{
"_id": "string",
"product_id": "string",
"amount": 0,
"cost": 0
}
],
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}This page is generated from the OpenAPI spec.