Skip to content
View as Markdown

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

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
statesstring[]No
organization_idstringNo
supplier_idstringNo
responsible_idstringNo
date_fromstring (date-time)No
date_tostring (date-time)No
searchstringNoFree-text search.
updated_atstring (date-time)NoOnly records updated at or after this time.
sort_bystringNoField name to sort by.
ascintegerNoSort 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

FieldTypeDescription
listany[]
totalnumber
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

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

FieldTypeDescription
_idstring
numberstring
organization_idstring
supplier_idstring
purchase_idstring
responsible_idstring
warehouse_idstring
currency_idstring
datestring (date-time)
statestringOne of: new, done, canceled
totalnumber
notestring
itemsobject[]
items[]._idstring
items[].product_idstring
items[].amountnumber
items[].costnumber
created_atstring (date-time)
updated_atstring (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.

Bito 2.0 Integration API