BTS API Hujjatlari
Buyurtma yaratish

Buyurtma yaratish

POST /v1/order/create

Buyurtma maʼlumotlari modeli. Ushbu model buyurtmaning umumiy maʼlumotlari, holatlari (statuslari), mijoz maʼlumotlari va yetkazib berish uchun zarur bo‘lgan maydonlarni o‘z ichiga oladi.

Order orqali buyurtmaning qachon va qayerga yetkazilishi, qaysi mahsulotlar buyurtma qilingani va ularning narxlari boshqariladi.

API Server http://wms.bts.uz:8040/
Base Path /v1/order/create
Full URL
http://wms.bts.uz:8040/v1/order/create
Authentication Bearer Token
Headers
Header
Value
Req.
Authorization
Bearer {token}
🔒
Content-Type
application/json
🔒
Accept
application/json
🔒

REQUEST

Request Body
                     
                     {
  "order_id": 1220011,
  "scheduled_at": "2024-10-03T14:00:00Z",
  "full_name": "Jon Done",
  "phone": "+998900000000",
  "address": "123 Main Street",
  "region": "Toshkent",
  "country": "Uzbekistan",
  "city": "Toshkent shahar",
  "zip": "100200",
  "order_items": [
    {
      "client_product_id": 1,
      "client_product_variation_id": 1,
      "quantity": 1,
      "price": 5000,
      "discount": 100000,
      "final_price": 95000
    }
  ]
}                     
                
Field Type Description
order_id * integer Buyurtma IDʼsi, har bir buyurtma uchun noyob raqam
scheduled_at * string Rejalashtirilgan yetkazib berish vaqti (kun va soat). Holat “Rejalashtirildi” bo‘lsa, ushbu maydon majburiy.
fulfillment_status * Buyurtma holati 1 – Yangi 2 – Yig‘ilmoqda 3 – Yopildi 4 – Yuklandi 5 – Rejalashtirildi 6 – Bekor qilindi 7 – Ochildi
full_name * string Mijozning to‘liq ismi
phone * string Mijozning telefon raqami
address * string Mijozning manzili
region * string Hudud yoki viloyat
country * string Davlat nomi
city string Shahar nomi
zip string Pochta indeksi
order_items * array<object> Buyurtma mahsulotlari ro‘yxati
client_product_id * integer Mahsulot IDʼsi
client_product_variation_id * integer Mahsulot variatsiyasi IDʼsi
quantity * integer Buyurtma miqdori (mahsulot soni)
price * integer Mahsulot narxi (1 dona uchun)
discount * integer Chegirma miqdori
final_price * integer Chegirmadan keyingi yakuniy narx

RESPONSE

200
Masalan: . Content-Type: application/json
Response Body
                                 
                                 {
  "message": "Record successfully created.",
  "data": {
    "id": 4,
    "order_id": 1220011,
    "supplier_buyer_id": 4,
    "fulfillment_status": 5,
    "created_at": "2026-01-26 13:28:49",
    "orderAddress": {
      "id": 4,
      "order_id": 4,
      "full_name": "Jon Done",
      "phone": "+998900000000",
      "address": "123 Main Street",
      "city": "Toshkent shahar",
      "region": "Toshkent",
      "zip": "100200",
      "country": "Uzbekistan",
      "status": 1
    },
    "orderItems": [
      {
        "id": 1,
        "order_id": 4,
        "product_id": 5,
        "client_product_id": 1,
        "quantity": 1,
        "price": 5000,
        "status": 0
      }
    ],
    "_links": {
      "self": {
        "href": "http://localhost:8070/v1/order/view?id=4"
      }
    }
  }
}                                 
                            
Field Type Description
message * string Amaliyot muvaffaqiyatli bajarilganligi haqida xabar
data * object Yaratilgan buyurtma haqida to‘liq ma’lumot
id * integer Buyurtmaning ichki identifikatori
order_id * integer Buyurtma raqami
supplier_buyer_id * integer Ta’minotchi yoki xaridor identifikatori
fulfillment_status * integer Buyurtmaning bajarilish holati
created_at * string Buyurtma yaratilgan sana va vaqt
orderAddress * object Buyurtma yetkazib berish manzili
full_name * string Mijozning to‘liq ismi
phone * string Mijozning telefon raqami
address * string Yetkazib berish manzili
city string Shahar nomi
region * string Hudud yoki viloyat
zip string Pochta indeksi
country * string Davlat nomi
orderItems * array<object> Buyurtmadagi mahsulotlar ro‘yxati
quantity * integer Mahsulot miqdori
price * integer Mahsulot narxi
_links * object Buyurtmaga oid foydali havolalar
self * string Buyurtmani ko‘rish uchun havola