Buyurtma yaratish
Buyurtma yaratish
POST
/v1/order/add
Buyurtma yaratish
REQUEST
Request Body
{
"clientId": "123",
"wcs_code": "900001",
"pickup_type": "courier",
"dropoff_type": "courier",
"is_sender_location": false,
"is_receiver_location": true,
"sender": {
"name": "Jurabek Turdiyev",
"phone": "+998991234560",
"address": "Toshkent sh., Bobur ko‘chasi, 5-A",
"city_code": "0101",
"branch_code": "0101"
},
"receiver": {
"name": "Odil Ahkmedov",
"phone": "+998991234567",
"phone1": "+998901096560",
"address": "Gozovo qish. 41 uy",
"latitude": "41.354213",
"longitude": "69.198745",
"city_code": "0101",
"branch_code": "0101"
},
"bringBackMoney":1,
"back_money" :10000,
"takePhoto":1,
"bringBackWaybill":1,
"cargo": {
"weight": 2,
"volume": 0,
"piece": 2,
"packageId":4,
"postTypeId":26,
"postTypes":[
{
"name": "Kitob",
"code": "ZFD21AD",
"count": 1,
"cost": 10000
},
{
"name": "Daftar",
"code": "AV2321",
"count": 2,
"cost": 20000
}
],
"options": [
{
"optionId": 2,
"goods": [
{
"mxikGoodsId": 71,
"amount": 1,
"goodPrice": 700000
},
{
"mxikGoodsId": 72,
"amount": 1,
"goodPrice": 100000
}
]
}
]
},
"ready_to_take": true
}
| Field | Type | Description |
|---|---|---|
clientId |
string | Mijozdagi buyurtma raqami yoki kodi |
pickup_type |
enum | Buyurtmani topshirish turi. ENUM type da bo'ladi {'self', 'courier'} self -> mijoz o'zi ofisga topshiradi courier-> mijoz qo'lidan olish |
dropoff_type |
enum | Buyurtmani qabul qilish turi. ENUM type da bo'ladi {'courier', 'branch'} courier-> mijoz qo'liga topshirish branch -> mijoz o'zi ofisdan qabul qilib oladi |
is_sender_location |
boolean | Yuboruvchi lokatsiya ma'lumotlarini berishi yoki yo'qligi, true holatda shahar code kerak bo'lmaydi |
is_receiver_location |
boolean | Qabul qiluvchi lokatsiya ma'lumotlarini berishi yoki yo'qligi, true holatda shahar code kerak bo'lmaydi |
sender[name] |
string | Yuboruvchi mijoz ismi familiyasi |
sender[phone] |
string | Yuboruvchining telefon raqami. Format +998901234567 |
sender[address] |
string | Yuboruvchi manzili |
sender[city_code] |
string | Yuboruvchi shahri(tumani) kodi |
sender[branch_code] |
string | Yuboruvchi filiali kodi |
receiver[name] |
string | Qabul qiluvchi ism familiyasi |
receiver[phone] |
string | Qabul qiluvchi telefon raqami. Format: +998901234567 |
receiver[phone1] |
string | Qabul qiluvchining qo'shimcha telefon raqami |
receiver[address] |
string | Qabul qiluvchi manzili |
receiver[latitude] |
string | Qabul qiluvchi Latitude |
receiver[longitude] |
string | Qabul qiluvchi longitude |
receiver[city_code] |
string | Qabul qiluvchi shahri(tumani) kodi |
receiver[branch_code] |
string | Qabul qiluvchi filial code |
bringBackMoney |
integer | Jo'natmani qaytish funksiyasi |
back_money |
float | Tovar narxi, bu qabul qiluvchidan olinib sizning hisob raqamingizga yo'naltiriladi |
takePhoto |
integer | Jo'natma yetkazilgani haqida foto hisobot |
cargo[weight] |
float | Jo'natma og'irligi, kg larda, Min: 0,001 kg, Max: 10000kg |
cargo[volume] |
float | Jo'natmaning eni, bo'yi va balandligini ko'paytmasi kiritiladi, sm(sanitmetrlarda) |
cargo[piece] |
integer | Jo'natmalar soni |
cargo[packageId] |
integer | Jo'natmaning qadog'i |
cargo[postTypeId] |
integer | Jo'natma ichida tovar nomi |
cargo[postTypes] |
array<object> | Jo'natma to'g'risida batafsil ma'lumotlar |
cargo[options] |
array<object> | Jo'natma uchun qo'shimcha xizmatlar |
RESPONSE
200
Success
Masalan: Success.
Content-Type:
application/json
Response Body
{
"status": true,
"message": "success.created",
"status_code": 200,
"data": {
"orderId": 4293644,
"clientId": "123",
"wcs_code": "900001",
"barcode": "019912312243",
"customer": {
"id": 4722,
"name": "ООО «HAPPY PILLS» 6716sss"
},
"status": {
"code": null,
"info": "У отправителя (У ОТПРАВИТЕЛЯ)"
},
"pickup_type": "courier",
"dropoff_type": "courier",
"sender": {
"name": null,
"phone": "+998991234560",
"address": "Toshkent sh., Bobur ko‘chasi, 5-A",
"region": {
"id": 6,
"name": "город Ташкент",
"code": "01"
},
"city": {
"id": 195,
"name": "Учтепа тумани",
"code": null
},
"village": null,
"branch": {
"id": 3,
"name": "YAKKASAROY",
"code": null
},
"latitude": null,
"longitude": null
},
"receiver": {
"name": "Odil Ahkmedov",
"phone": "+998991234567",
"phone1": "+998901096560",
"address": "Gozovo qish. 41 uy",
"region": {
"id": 6,
"name": "город Ташкент",
"code": "01"
},
"city": {
"id": 195,
"name": "Учтепа тумани",
"code": null
},
"village": null,
"branch": {
"id": 112,
"name": "FARHOD",
"code": null
},
"latitude": "41.354213",
"longitude": "69.198745",
"stickerData": {
"hubName": "Тошкент шахри 01",
"cityName": "Uchtepa tumani",
"branchName": "0124 - FARHOD <b> (Д-КА)</b>",
"zonaId": 26
}
},
"cargo": {
"weight": 2,
"volume": 0,
"piece": 2,
"package": {
"id": 4,
"name": "СУМКА"
},
"postType": {
"id": 26,
"name": "KANTSELYARIYA TOVARLARI"
},
"postTypes": [
{
"child_id": 58,
"barcode": "019914293644001",
"packageId": 0,
"weight": 0,
"name": "Kitob",
"code": "ZFD21AD",
"count": 1,
"cost": "10000.00"
},
{
"child_id": 59,
"barcode": "019914293644002",
"packageId": 0,
"weight": 0,
"name": "Daftar",
"code": "AV2321",
"count": 2,
"cost": "20000.00"
}
],
"options": {
"with_unired": null,
"urgent": null,
"takePhoto": 1,
"bringBackWaybill": 1,
"bringBackMoney": 1,
"back_money": "10000"
}
},
"cost": 227000,
"senderDate": "2026-01-05",
"receiverDate": "2026-01-05",
"declarations": [],
"goods": [],
"inn": null,
"ready_to_take": true,
"tracking": "https://bts.uz/uz/waybill-tracking?term=eyJ3YXliaWxsX2lkIjo0MjkzNjQ0LCJiYXJjb2RlIjoiMDE5OTEyMzEyMjQzIiwiaXNfcmVjZWl2ZXIiOm51bGx9"
}
}
| Field | Type | Description |
|---|---|---|
orderId |
integer | Buyurtma ID si |
clientId |
integer | Mijoz ID si |
wcs_code |
string | WCS kodi |
barcode |
string | Barkod |
customer[id] |
integer | Mijoz id si |
customer[id] |
string | Mijoz ismi |
status[info] |
string | Status haqida ma'lumot |
pickup_type |
string | Pickup turi |
dropoff_type |
string | Dropoff turi |
sender[name] |
string | Jo'natuvchi Ismi |
sender[phone] |
string | Jo'natuvchi telefon raqami |
sender[address] |
string | Jo'natuvchi manzili |
sender[region][id] |
integer | Yuboruvchi mintaqa ID si |
sender[region][name] |
string | Yuboruvchi mintaqasi nomi |
sender[region][code] |
string | Jo'natuvchining mintaqa kodi |
sender[city][id] |
integer | Yuboruvchi shahar identifikatori |
sender[city][name] |
string | Yuboruvchi Shahar Nomi |
sender[city][code] |
string | Yuboruvchi shahar kodi |
sender[branch][id] |
integer | Jo'natuvchi filiali identifikatori |
sender[branch][name] |
string | Jo'natuvchi filialining nomi |
sender[latitude] |
string | Yuboruvchi latitudi |
sender[longitude] |
string | Yuboruvchi longitudi |
receiver[name] |
string | Qabul qiluvchining ismi |
receiver[phone] |
string | Qabul qilgich telefoni |
receiver[phone1] |
string | Qabul qilgich telefoni 1 |
receiver[address] |
string | Qabul qiluvchining manzili |
receiver[region][id] |
Qabul qiluvchi mintaqa identifikatori | |
receiver[region][name] |
string | Qabul qiluvchi mintaqa nomi |
receiver[region][code] |
string | Qabul qiluvchining mintaqaviy kodi |
receiver[city][id] |
integer | Qabul qiluvchi shahar identifikatori |
receiver[city][name] |
string | Qabul qiluvchi shahar nomi |
receiver[city][code] |
string | Qabul qiluvchining shahar kodi |
receiver[village] |
integer | Qabul qiluvchi qishlog'i |
receiver[branch][id] |
integer | Qabul qiluvchi filial identifikatori |
receiver[branch][name] |
string | Qabul qiluvchi filial nomi |
receiver[branch][code] |
string | Qabul qiluvchi filial kodi |
receiver[latitude] |
string | Qabul qiluvchi latitudi |
receiver[longitude] |
string | Qabul qiluvchi longitudi |
receiver[stickerData][hubName] |
string | Qabul qiluvchi stiker ma'lumotlar markazi nomi |
receiver[stickerData][cityName] |
string | Qabul qiluvchi stiker ma'lumotlari shahar nomi |
receiver[stickerData][branchName] |
string | Qabul qiluvchi stiker ma'lumotlari bo'limi nomi |
receiver[stickerData][zonaId] |
integer | Qabul qiluvchi stikerining ma'lumotlar zonasi identifikatori |
cargo[weight] |
float | Yuk og'irligi |
cargo[volume] |
float | Yuk Hajmi |
cargo[piece] |
integer | Yuk Soni |
cargo[package][id] |
integer | Yuk paketi identifikatori |
cargo[package][name] |
string | Yuk paketining nomi |
cargo[postType][id] |
integer | Yuk pochtasi turi identifikatori |
cargo[postType][name] |
string | Yuk posti turi nomi |
cargo[postTypes][child_id] |
integer | Yuk posti turlari Bola identifikatori |
cargo[postTypes][barcode] |
string | Yuk pochtasi turlari shtrix-kodi |
cargo[postTypes][packageId] |
integer | Yuk pochtasi turlari Paket identifikatori |
cargo[postTypes][weight] |
float | Yuk postlari turlarining og'irligi |
cargo[postTypes][name] |
string | Yuk posti turlarining nomi |
cargo[postTypes][code] |
string | Yuk pochtasi turlari kodi |
cargo[postTypes][count] |
integer | Yuk postlari turlari soni |
cargo[postTypes][cost] |
float | Yuk pochtasi turlari narxi |
cargo[options][with_unired] |
string | |
cargo[options][urgent] |
string | Yuk tashish imkoniyatlari shoshilinch |
cargo[options][takePhoto] |
integer | Yuk tashish imkoniyatlari Suratga olish |
cargo[options][bringBackWaybill] |
||
cargo[options][bringBackMoney] |
integer | |
cargo[options][back_money] |
float | |
cost |
integer | Narx |
senderDate |
string | Yuk Jonatilgan Sana |
receiverDate |
string | Yuk yetkazib berilgan sana |
inn |
string | soliq to‘lovchining identifikatsiya raqami |
ready_to_take |
boolean | Olishga Tayyor |
tracking |
string | Yuk qayerdaligini ko'rish uchun link |
422
Validate dagi xatolik
Masalan: Validate dagi xatolik.
Content-Type:
application/json
Response Body
{
"status": false,
"message": "error.validation",
"status_code": 422,
"errors": {
"pickup_type": [
"Invalid pickup type"
],
"dropoff_type": [
"Invalid dropoff type"
],
"receiverCityId": [
"«Receiver City Id» to`ldirish shart."
]
}
}
No schema defined.
500
Masalan: .
Content-Type:
application/json
Response Body
{
"status": false,
"message":"Failed to create order: {\"errors\":[],\"other_errors\":{\"senderCityId\":».\"]}}",
"status_code": 500
}
No schema defined.