Purchase return
INFO
Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.
POST /purchase-return/get-paging
Paginated list of purchase returns with optional filters.
Kerakli ruxsat: purchase_return · ruxsatlar qanday ishlaydi
So‘rov namunasi
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);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
states | string[] | Yo‘q | |
organization_id | string | Yo‘q | |
supplier_id | string | Yo‘q | |
responsible_id | string | Yo‘q | |
date_from | string (date-time) | Yo‘q | |
date_to | string (date-time) | Yo‘q | |
search | string | Yo‘q | Free-text search. |
updated_at | string (date-time) | Yo‘q | Only records updated at or after this time. |
sort_by | string | Yo‘q | Field name to sort by. |
asc | integer | Yo‘q | Sort direction: 1 ascending, -1 descending.. Mumkin qiymatlar: -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
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
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).
Kerakli ruxsat: purchase_return · ruxsatlar qanday ishlaydi
So‘rov namunasi
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);Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_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 | Mumkin qiymatlar: 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"
}Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.