Kitobchi Kitobchi Developer API
OpenAPI
Kitobchi API / Mahsulotlar API

Mahsulotlar API

Kitob, kanselyariya, tavsiyalar va seller mahsulotlarini olish.

Mahsulotlar

Katalogni tashqi servis, hamkor vitrina yoki marketplace integratsiyasiga chiqarish uchun. Javoblarda nom, narx, rasm, kategoriya, seller va zaxira holati keladi. Barcha endpointlar read ability va GET cache bilan ishlaydi.

GET https://kitobchi.com/api/v1/client/products/{col} cache read

Mahsulotlar ro‘yxati

Katalogdagi mahsulotlarni turi bo‘yicha sahifalab qaytaradi.

ParametrTuriJoyMajburiyIzoh
col string path ha Mahsulot turi: books yoki stationery.
page integer query yo‘q Sahifa raqami (1 dan boshlanadi).
q string query yo‘q Nom bo‘yicha filtr.
sort string query yo‘q Tartiblash: popular, new, price_asc, price_desc.
curl --request GET \
  --url 'https://kitobchi.com/api/v1/client/products/books?page=1' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://kitobchi.com/api/v1/client/products/books?page=1", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://kitobchi.com/api/v1/client/products/books?page=1");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://kitobchi.com/api/v1/client/products/books?page=1",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob namunasi 200 OK
{
    "status": "success",
    "data": [
        {
            "id": 128,
            "name": "Atomic Habits",
            "price": 89000,
            "old_price": 99000,
            "image": "https://kitobchi.com/storage/books/128.jpg",
            "type": "book",
            "in_stock": true,
            "seller_id": 12
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 20,
        "total": 342
    }
}
Sinab ko‘rish
GET https://kitobchi.com/api/v1/client/products/recommendation/{col} cache read

Tavsiya qilingan mahsulotlar

Vitrina va “sizga mos” bloklari uchun tavsiya ro‘yxati.

ParametrTuriJoyMajburiyIzoh
col string path ha Mahsulot turi: books yoki stationery.
curl --request GET \
  --url 'https://kitobchi.com/api/v1/client/products/recommendation/books' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://kitobchi.com/api/v1/client/products/recommendation/books", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://kitobchi.com/api/v1/client/products/recommendation/books");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://kitobchi.com/api/v1/client/products/recommendation/books",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob namunasi 200 OK
{
    "status": "success",
    "data": [
        {
            "id": 305,
            "name": "Deep Work",
            "price": 76000,
            "image": "https://kitobchi.com/storage/books/305.jpg",
            "type": "book",
            "in_stock": true
        }
    ]
}
Sinab ko‘rish
GET https://kitobchi.com/api/v1/client/products/sellers/list cache read

Sellerlar va oxirgi mahsulotlari

Do‘konlar ro‘yxati va har biri uchun eng so‘nggi mahsulotlar.

ParametrTuriJoyMajburiyIzoh
page integer query yo‘q Sahifa raqami.
curl --request GET \
  --url 'https://kitobchi.com/api/v1/client/products/sellers/list?page=1' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://kitobchi.com/api/v1/client/products/sellers/list?page=1", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://kitobchi.com/api/v1/client/products/sellers/list?page=1");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://kitobchi.com/api/v1/client/products/sellers/list?page=1",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob namunasi 200 OK
{
    "status": "success",
    "data": [
        {
            "id": 12,
            "name": "Asaxiy Books",
            "logo": "https://kitobchi.com/storage/sellers/12.png",
            "rating": 4.8,
            "latest_products": []
        }
    ]
}
Sinab ko‘rish
GET https://kitobchi.com/api/v1/client/products/sellers/by-qr/{token} cache read

QR orqali seller

QR token orqali do‘kon ma’lumotini olish.

ParametrTuriJoyMajburiyIzoh
token string path ha Seller QR tokeni.
curl --request GET \
  --url 'https://kitobchi.com/api/v1/client/products/sellers/by-qr/qr_9f3c1a' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://kitobchi.com/api/v1/client/products/sellers/by-qr/qr_9f3c1a", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://kitobchi.com/api/v1/client/products/sellers/by-qr/qr_9f3c1a");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://kitobchi.com/api/v1/client/products/sellers/by-qr/qr_9f3c1a",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob namunasi 200 OK
{
    "status": "success",
    "data": {
        "id": 12,
        "name": "Asaxiy Books",
        "rating": 4.8
    }
}
Sinab ko‘rish
GET https://kitobchi.com/api/v1/client/products/sellers/profile/{id}/{page} cache read

Seller profili

Do‘kon profili va uning sahifalangan mahsulotlari.

ParametrTuriJoyMajburiyIzoh
id integer path ha Seller ID.
page integer path ha Mahsulotlar sahifasi.
curl --request GET \
  --url 'https://kitobchi.com/api/v1/client/products/sellers/profile/12/1' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://kitobchi.com/api/v1/client/products/sellers/profile/12/1", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://kitobchi.com/api/v1/client/products/sellers/profile/12/1");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://kitobchi.com/api/v1/client/products/sellers/profile/12/1",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob namunasi 200 OK
{
    "status": "success",
    "data": {
        "id": 12,
        "name": "Asaxiy Books",
        "products": [],
        "meta": {
            "page": 1,
            "total": 240
        }
    }
}
Sinab ko‘rish
GET https://kitobchi.com/api/v1/client/products/sellers/{sellerId}/code/{code} cache read

Shtrix-kod / ISBN bo‘yicha mahsulot

Do‘kon ichidan shtrix-kod yoki ISBN orqali bitta mahsulotni topadi. `/isbn/{isbn}` alias ham mavjud.

ParametrTuriJoyMajburiyIzoh
sellerId integer path ha Seller ID.
code string path ha Shtrix-kod yoki ISBN.
curl --request GET \
  --url 'https://kitobchi.com/api/v1/client/products/sellers/12/code/9781847941831' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://kitobchi.com/api/v1/client/products/sellers/12/code/9781847941831", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://kitobchi.com/api/v1/client/products/sellers/12/code/9781847941831");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://kitobchi.com/api/v1/client/products/sellers/12/code/9781847941831",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob namunasi 200 OK
{
    "status": "success",
    "data": {
        "id": 128,
        "name": "Atomic Habits",
        "price": 89000,
        "in_stock": true,
        "seller_id": 12
    }
}
Sinab ko‘rish