API Reference
MilliySavdo REST API ning barcha endpointlari: parametrlar, so'rov va javob sxemalari, sandbox'dan olingan haqiqiy misollar.
- Base URL
- https://api.milliysavdo.uz/v1
- Versiya
- 2026-10-16
- Autentifikatsiya
- Authorization: Bearer
Misollar haqida
$MILLIYSAVDO_API_KEY muhit o'zgaruvchisi ishlatilgan — kalitni hech qachon kodga yozmang.Akkaunt
Kalit, limitlar va balans
Akkaunt
Kalit va limitlar haqida
/v1/meKalit qaysi rejimda (test/live), qaysi ruxsatlar bilan ishlayotgani va amaldagi limitlar.
Bearer API kalitscope: catalog:read
Javoblar
- 200Muvaffaqiyatli
Me - 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilingan
Problem - 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmagan
Problem - 429Rate-limit yoki kvota oshdi (
Retry-Afterheaderiga qarang)Problem
Me obyekti maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
| object | "api_key_info" | standart: api_key_info |
| modemajburiy | enum | testlive |
| keymajburiy | KeyInfo | |
| ↳ namemajburiy | string | |
| ↳ prefixmajburiy | string | Kalitning maskalangan ko'rinishi |
| ↳ modemajburiy | enum | testlive |
| ↳ scopesmajburiy | string[] | |
| ↳ expires_at | string | null | format: date-time |
| accountmajburiy | object | tier (demo|production) va kompaniya nomi |
| limitsmajburiy | Limits | |
| ↳ rate_limit_per_minutemajburiy | integer | |
| ↳ daily_request_quotamajburiy | integer | |
| ↳ monthly_request_quotamajburiy | integer | |
| ↳ daily_order_limitmajburiy | integer | |
| ↳ max_active_ordersmajburiy | integer | |
| ↳ discount_percentmajburiy | string |
curl 'https://api.milliysavdo.uz/v1/me' \
-H "Authorization: Bearer $MILLIYSAVDO_API_KEY"{
"object": "api_key_info",
"mode": "test",
"key": {
"name": "Backend server",
"prefix": "ms_test_TeqriX…nZa9",
"mode": "test",
"scopes": [
"catalog:read",
"balance:read",
"orders:read",
"orders:write"
],
"expires_at": "2027-10-16T02:13:52.090617Z"
},
"account": {
"tier": "production",
"company_name": "Acme LLC"
},
"limits": {
"rate_limit_per_minute": 600,
"daily_request_quota": 500000,
"monthly_request_quota": 10000000,
"daily_order_limit": 5000,
"max_active_orders": 100,
"discount_percent": "10.00"
}
}{
"type": "https://api.milliysavdo.uz/docs/errors#authentication_required",
"title": "API kalit berilmagan",
"status": 401,
"detail": "API kalit berilmagan: `Authorization: Bearer <key>`",
"code": "authentication_required",
"request_id": "req_5393565545d9cd88db93af5e"
}{
"type": "https://api.milliysavdo.uz/docs/errors#invalid_api_key",
"title": "API kalit yaroqsiz",
"status": 401,
"detail": "API kalit yaroqsiz",
"code": "invalid_api_key",
"request_id": "req_6ce93e48484857655fdcdae7"
}Akkaunt
Balans
/v1/balanceLive: MilliySavdo hisobingiz balansi (sayt bilan umumiy). Test: virtual balans, kamaymaydi.
Bearer API kalitscope: balance:read
Javoblar
- 200Muvaffaqiyatli
Balance - 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilingan
Problem - 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmagan
Problem - 429Rate-limit yoki kvota oshdi (
Retry-Afterheaderiga qarang)Problem
Balance obyekti maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
| object | "balance" | standart: balance |
| modemajburiy | enum | testlive |
| amountmajburiy | string | |
| amount_centsmajburiy | integer | |
| currency | "UZS" | standart: UZS |
| note | string | null | Test rejimida balans virtual |
curl 'https://api.milliysavdo.uz/v1/balance' \
-H "Authorization: Bearer $MILLIYSAVDO_API_KEY"{
"object": "balance",
"mode": "test",
"amount": "1000000.00",
"amount_cents": 100000000,
"currency": "UZS",
"note": "Sandbox: virtual balans, buyurtmalar pul yechmaydi"
}{
"object": "balance",
"mode": "live",
"amount": "250000.00",
"amount_cents": 25000000,
"currency": "UZS",
"note": null
}Katalog
Davlatlar, xizmatlar va narxlar
Katalog
Davlatlar
/v1/countriesHozir raqam olish mumkin bo'lgan davlatlar (mashhurlari birinchi).
Bearer API kalitscope: catalog:read
Javoblar
- 200Muvaffaqiyatli
ListResponse_Country_ - 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilingan
Problem - 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmagan
Problem - 429Rate-limit yoki kvota oshdi (
Retry-Afterheaderiga qarang)Problem
ListResponse_Country_ obyekti maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
| object | "list" | standart: list |
| datamajburiy | Country[] | |
| ↳ idmajburiy | integer | |
| ↳ namemajburiy | string | |
| ↳ iso_code | string | null | |
| ↳ phone_codemajburiy | string | |
| ↳ flag | string | null | |
| ↳ popular | boolean | standart: false |
| has_moremajburiy | boolean | Yana sahifa bormi |
| next_cursor | string | null | Keyingi sahifa uchun starting_after qiymati |
curl 'https://api.milliysavdo.uz/v1/countries' \
-H "Authorization: Bearer $MILLIYSAVDO_API_KEY"{
"object": "list",
"data": [
{
"id": 1,
"name": "Testland 0533ef",
"iso_code": "TL",
"phone_code": "998",
"flag": null,
"popular": true
},
{
"id": 4,
"name": "Testland 10f896",
"iso_code": "TL",
"phone_code": "998",
"flag": null,
"popular": true
},
{
"id": 5,
"name": "Testland 2622fd",
"iso_code": "TL",
"phone_code": "998",
"flag": null,
"popular": true
},
{
"id": 2,
"name": "Testland 39a357",
"iso_code": "TL",
"phone_code": "998",
"flag": null,
"popular": true
},
{
"id": 7,
"name": "Testland 581871",
"iso_code": "TL",
"phone_code": "998",
"flag": null,
"popular": true
},
{
"id": 3,
"name": "Testland d72c02",
"iso_code": "TL",
"phone_code": "998",
"flag": null,
"popular": true
},
{
"id": 6,
"name": "United States",
"iso_code": "US",
"phone_code": "1",
"flag": "🇺🇸",
"popular": true
}
],
"has_more": false,
"next_cursor": null
}Katalog
Davlatdagi xizmatlar va narxlar
/v1/servicesNarx — sizning chegirmangiz qo'llangan holda. next_cursor — keyingi offset.
Bearer API kalitscope: catalog:read
Parametrlar
| Nomi | Joyi | Turi | Tavsif |
|---|---|---|---|
| country_idmajburiy | query | integer | /v1/countries dagi idminimum: 1 |
| q | query | string | null | Nomi yoki kodi bo'yicha qidiruvmaxLength: 64 |
| category | query | string | null | maxLength: 32 |
| limit | query | integer | minimum: 1 · maximum: 200 · standart: 100 |
| offset | query | integer | minimum: 0 · maximum: 100000 · standart: 0 |
Javoblar
- 200Muvaffaqiyatli
ListResponse_Service_ - 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilingan
Problem - 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmagan
Problem - 422Validation Error
HTTPValidationError - 429Rate-limit yoki kvota oshdi (
Retry-Afterheaderiga qarang)Problem
ListResponse_Service_ obyekti maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
| object | "list" | standart: list |
| datamajburiy | Service[] | |
| ↳ codemajburiy | string | |
| ↳ titlemajburiy | string | |
| ↳ category | string | null | |
| ↳ country_idmajburiy | integer | |
| ↳ logo_url | string | null | |
| ↳ in_stockmajburiy | integer | Taxminiy zaxira (provayder ma'lumoti) |
| ↳ availablemajburiy | boolean | false — provayder tomonida vaqtincha yopiq |
| ↳ pricemajburiy | Price | |
| ↳ amountmajburiy | string | Chegirmali narx, so'm (string — suzuvchi nuqta xatosiz) |
| ↳ amount_centsmajburiy | integer | Chegirmali narx, tiyin |
| ↳ retail_amountmajburiy | string | Saytdagi chakana narx, so'm |
| ↳ retail_amount_centsmajburiy | integer | |
| ↳ discount_percentmajburiy | string | Qo'llangan chegirma, % |
| ↳ currency | "UZS" | standart: UZS |
| has_moremajburiy | boolean | Yana sahifa bormi |
| next_cursor | string | null | Keyingi sahifa uchun starting_after qiymati |
curl 'https://api.milliysavdo.uz/v1/services?country_id=6&limit=2' \
-H "Authorization: Bearer $MILLIYSAVDO_API_KEY"{
"object": "list",
"data": [
{
"code": "907",
"title": "Telegram",
"category": "messenger",
"country_id": 6,
"logo_url": null,
"in_stock": 1239,
"available": true,
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
}
},
{
"code": "1012",
"title": "WhatsApp",
"category": "messenger",
"country_id": 6,
"logo_url": null,
"in_stock": 1240,
"available": true,
"price": {
"amount": "13832.78",
"amount_cents": 1383278,
"retail_amount": "15369.75",
"retail_amount_cents": 1536975,
"discount_percent": "10.00",
"currency": "UZS"
}
}
],
"has_more": true,
"next_cursor": "2"
}Katalog
Xizmat narxi barcha davlatlarda
/v1/pricesEng arzonidan boshlab saralangan.
Bearer API kalitscope: catalog:read
Parametrlar
| Nomi | Joyi | Turi | Tavsif |
|---|---|---|---|
| service_codemajburiy | query | string | maxLength: 50 |
| limit | query | integer | minimum: 1 · maximum: 200 · standart: 50 |
Javoblar
- 200Muvaffaqiyatli
ListResponse_ServicePrice_ - 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilingan
Problem - 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmagan
Problem - 422Validation Error
HTTPValidationError - 429Rate-limit yoki kvota oshdi (
Retry-Afterheaderiga qarang)Problem
ListResponse_ServicePrice_ obyekti maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
| object | "list" | standart: list |
| datamajburiy | ServicePrice[] | |
| ↳ countrymajburiy | OrderCountry | |
| ↳ idmajburiy | integer | |
| ↳ name | string | null | |
| ↳ iso_code | string | null | |
| ↳ servicemajburiy | OrderService | |
| ↳ code | string | null | |
| ↳ title | string | null | |
| ↳ in_stockmajburiy | integer | |
| ↳ availablemajburiy | boolean | |
| ↳ pricemajburiy | Price | |
| ↳ amountmajburiy | string | Chegirmali narx, so'm (string — suzuvchi nuqta xatosiz) |
| ↳ amount_centsmajburiy | integer | Chegirmali narx, tiyin |
| ↳ retail_amountmajburiy | string | Saytdagi chakana narx, so'm |
| ↳ retail_amount_centsmajburiy | integer | |
| ↳ discount_percentmajburiy | string | Qo'llangan chegirma, % |
| ↳ currency | "UZS" | standart: UZS |
| has_moremajburiy | boolean | Yana sahifa bormi |
| next_cursor | string | null | Keyingi sahifa uchun starting_after qiymati |
curl 'https://api.milliysavdo.uz/v1/prices?service_code=907&limit=3' \
-H "Authorization: Bearer $MILLIYSAVDO_API_KEY"{
"object": "list",
"data": [
{
"country": {
"id": 6,
"name": "United States",
"iso_code": "US"
},
"service": {
"code": "907",
"title": "Telegram"
},
"in_stock": 1239,
"available": true,
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
}
}
],
"has_more": false,
"next_cursor": null
}Buyurtmalar
Raqam olish, SMS kodni kutish, bekor qilish
Buyurtmalar
Raqam olish (buyurtma yaratish)
/v1/ordersLive kalit: balansdan yechiladi, SMS 20 daqiqada kelmasa pul avtomatik qaytadi. Test kalit: simulyatsiya, pul yechilmaydi.
Idempotency-Key yuboring: tarmoq uzilib qayta yuborsangiz ikkinchi raqam olinmaydi — o'sha buyurtma 200 va Idempotent-Replayed: true bilan qaytadi.
Bearer API kalitscope: orders:write
Parametrlar
| Nomi | Joyi | Turi | Tavsif |
|---|---|---|---|
| Idempotency-Key | header | string | null | maxLength: 80 |
So'rov body application/json · OrderCreate
| Maydon | Turi | Tavsif |
|---|---|---|
| country_idmajburiy | integer | GET /v1/countries dagi idmin: 1 |
| service_codemajburiy | string | minLength: 1 · maxLength: 50 · pattern: ^[A-Za-z0-9_.-]+$ |
| sandbox_scenario | enum | null | Faqat test kalitlari: success — ~8 soniyada SMS keladi (standart); no_sms — SMS kelmaydi, 20 daqiqada expired; expire_fast — 30 soniyada expired.successno_smsexpire_fast |
Javoblar
- 200Idempotent takror — avvalgi buyurtma
Order - 201Muvaffaqiyatli
Order - 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilingan
Problem - 402Balans yetarli emas
Problem - 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmagan
Problem - 404Xizmat/davlat topilmadi
Problem - 409Raqamlar tugagan / xizmat vaqtincha yopiq / parallel so'rov
Problem - 422Validatsiya xatosi yoki Idempotency-Key qayta ishlatilgan
Problem - 429Rate-limit yoki kvota oshdi (
Retry-Afterheaderiga qarang)Problem
Order obyekti maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
| idmajburiy | string | ord_<n> (live) yoki ord_test_<n> (test) |
| object | "order" | standart: order |
| modemajburiy | enum | testlive |
| statusmajburiy | enum | waiting_sms → sms_received | cancelled | expired | failed. Yakuniy holatlarda pul qaytarilgan (sms_received bundan mustasno).waiting_smssms_receivedcancelledexpiredfailed |
| phonemajburiy | string | |
| sms_code | string | null | |
| countrymajburiy | OrderCountry | |
| ↳ idmajburiy | integer | |
| ↳ name | string | null | |
| ↳ iso_code | string | null | |
| servicemajburiy | OrderService | |
| ↳ code | string | null | |
| ↳ title | string | null | |
| pricemajburiy | Price | |
| ↳ amountmajburiy | string | Chegirmali narx, so'm (string — suzuvchi nuqta xatosiz) |
| ↳ amount_centsmajburiy | integer | Chegirmali narx, tiyin |
| ↳ retail_amountmajburiy | string | Saytdagi chakana narx, so'm |
| ↳ retail_amount_centsmajburiy | integer | |
| ↳ discount_percentmajburiy | string | Qo'llangan chegirma, % |
| ↳ currency | "UZS" | standart: UZS |
| created_atmajburiy | string | format: date-time |
| expires_atmajburiy | string | Shu vaqtgacha SMS kelmasa buyurtma expired bo'ladi va pul qaytadiformat: date-time |
| completed_at | string | null | format: date-time |
curl -X POST 'https://api.milliysavdo.uz/v1/orders' \
-H "Authorization: Bearer $MILLIYSAVDO_API_KEY" \
-H 'Idempotency-Key: 8f14e45f-ceea-4e1a-9b2c-0d3c5e7a1b20' \
-H "Content-Type: application/json" \
-d '{"country_id":6,"service_code":"907"}'{
"id": "ord_test_14",
"object": "order",
"mode": "test",
"status": "waiting_sms",
"phone": "+1888582997",
"sms_code": null,
"country": {
"id": 6,
"name": "United States",
"iso_code": null
},
"service": {
"code": "907",
"title": "Telegram"
},
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
},
"created_at": "2026-10-16T02:13:52.251868Z",
"expires_at": "2026-10-16T02:33:52.251868Z",
"completed_at": null
}{
"id": "ord_test_14",
"object": "order",
"mode": "test",
"status": "waiting_sms",
"phone": "+1888582997",
"sms_code": null,
"country": {
"id": 6,
"name": "United States",
"iso_code": null
},
"service": {
"code": "907",
"title": "Telegram"
},
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
},
"created_at": "2026-10-16T02:13:52.251868Z",
"expires_at": "2026-10-16T02:33:52.251868Z",
"completed_at": null
}{
"id": "ord_8",
"object": "order",
"mode": "live",
"status": "waiting_sms",
"phone": "+11930624673",
"sms_code": null,
"country": {
"id": 6,
"name": "United States",
"iso_code": "US"
},
"service": {
"code": "907",
"title": "Telegram"
},
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
},
"created_at": "2026-10-16T02:13:52.385529Z",
"expires_at": "2026-10-16T02:33:52.384337Z",
"completed_at": null
}{
"type": "https://api.milliysavdo.uz/docs/errors#insufficient_balance",
"title": "Balans yetarli emas",
"status": 402,
"detail": "Balans yetarli emas",
"code": "insufficient_balance",
"request_id": "req_28b731c19944da9edf9f2c98"
}{
"type": "https://api.milliysavdo.uz/docs/errors#validation_error",
"title": "Maydonlar tekshiruvdan o'tmadi",
"status": 422,
"detail": "So'rov maydonlari noto'g'ri",
"code": "validation_error",
"errors": [
{
"field": "country_id",
"message": "Input should be greater than or equal to 1",
"type": "greater_than_equal"
},
{
"field": "service_code",
"message": "Field required",
"type": "missing"
}
],
"request_id": "req_a9ce2c4d85f7162a99297d2c"
}Buyurtmalar
Buyurtmalar ro'yxati
/v1/ordersFaqat API orqali olingan buyurtmalar, yangilari birinchi.
Bearer API kalitscope: orders:read
Parametrlar
| Nomi | Joyi | Turi | Tavsif |
|---|---|---|---|
| status | query | string | null | waiting_sms | sms_received | cancelled | expired | failed |
| limit | query | integer | minimum: 1 · maximum: 100 · standart: 20 |
| starting_after | query | string | null | Oldingi sahifadagi next_cursormaxLength: 40 |
Javoblar
- 200Muvaffaqiyatli
ListResponse_Order_ - 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilingan
Problem - 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmagan
Problem - 422Validation Error
HTTPValidationError - 429Rate-limit yoki kvota oshdi (
Retry-Afterheaderiga qarang)Problem
ListResponse_Order_ obyekti maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
| object | "list" | standart: list |
| datamajburiy | Order[] | |
| ↳ idmajburiy | string | ord_<n> (live) yoki ord_test_<n> (test) |
| ↳ object | "order" | standart: order |
| ↳ modemajburiy | enum | testlive |
| ↳ statusmajburiy | enum | waiting_sms → sms_received | cancelled | expired | failed. Yakuniy holatlarda pul qaytarilgan (sms_received bundan mustasno).waiting_smssms_receivedcancelledexpiredfailed |
| ↳ phonemajburiy | string | |
| ↳ sms_code | string | null | |
| ↳ countrymajburiy | OrderCountry | |
| ↳ idmajburiy | integer | |
| ↳ name | string | null | |
| ↳ iso_code | string | null | |
| ↳ servicemajburiy | OrderService | |
| ↳ code | string | null | |
| ↳ title | string | null | |
| ↳ pricemajburiy | Price | |
| ↳ amountmajburiy | string | Chegirmali narx, so'm (string — suzuvchi nuqta xatosiz) |
| ↳ amount_centsmajburiy | integer | Chegirmali narx, tiyin |
| ↳ retail_amountmajburiy | string | Saytdagi chakana narx, so'm |
| ↳ retail_amount_centsmajburiy | integer | |
| ↳ discount_percentmajburiy | string | Qo'llangan chegirma, % |
| ↳ currency | "UZS" | standart: UZS |
| ↳ created_atmajburiy | string | format: date-time |
| ↳ expires_atmajburiy | string | Shu vaqtgacha SMS kelmasa buyurtma expired bo'ladi va pul qaytadiformat: date-time |
| ↳ completed_at | string | null | format: date-time |
| has_moremajburiy | boolean | Yana sahifa bormi |
| next_cursor | string | null | Keyingi sahifa uchun starting_after qiymati |
curl 'https://api.milliysavdo.uz/v1/orders?limit=2' \
-H "Authorization: Bearer $MILLIYSAVDO_API_KEY"{
"object": "list",
"data": [
{
"id": "ord_test_15",
"object": "order",
"mode": "test",
"status": "cancelled",
"phone": "+1231407863",
"sms_code": null,
"country": {
"id": 6,
"name": "United States",
"iso_code": null
},
"service": {
"code": "907",
"title": "Telegram"
},
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
},
"created_at": "2026-10-16T02:13:52.318700Z",
"expires_at": "2026-10-16T02:33:52.318700Z",
"completed_at": "2026-10-16T02:13:52.343024Z"
},
{
"id": "ord_test_14",
"object": "order",
"mode": "test",
"status": "sms_received",
"phone": "+1888582997",
"sms_code": "636841",
"country": {
"id": 6,
"name": "United States",
"iso_code": null
},
"service": {
"code": "907",
"title": "Telegram"
},
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
},
"created_at": "2026-10-16T02:13:52.251868Z",
"expires_at": "2026-10-16T02:33:52.251868Z",
"completed_at": "2026-10-16T02:13:52.301158Z"
}
],
"has_more": false,
"next_cursor": null
}Buyurtmalar
Buyurtma holati va SMS kod
/v1/orders/{order_id}SMS kodni olish uchun shu endpointni 3–5 soniyada bir so'rang yoki webhook'dan foydalaning (order.sms_received). Har so'rov provayder holatini ham yangilaydi.
Bearer API kalitscope: orders:read
Parametrlar
| Nomi | Joyi | Turi | Tavsif |
|---|---|---|---|
| order_idmajburiy | path | string | ord_<n> (live) yoki ord_test_<n> (test)maxLength: 40 |
Javoblar
- 200Muvaffaqiyatli
Order - 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilingan
Problem - 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmagan
Problem - 404Not Found
Problem - 422Validation Error
HTTPValidationError - 429Rate-limit yoki kvota oshdi (
Retry-Afterheaderiga qarang)Problem
Order obyekti maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
| idmajburiy | string | ord_<n> (live) yoki ord_test_<n> (test) |
| object | "order" | standart: order |
| modemajburiy | enum | testlive |
| statusmajburiy | enum | waiting_sms → sms_received | cancelled | expired | failed. Yakuniy holatlarda pul qaytarilgan (sms_received bundan mustasno).waiting_smssms_receivedcancelledexpiredfailed |
| phonemajburiy | string | |
| sms_code | string | null | |
| countrymajburiy | OrderCountry | |
| ↳ idmajburiy | integer | |
| ↳ name | string | null | |
| ↳ iso_code | string | null | |
| servicemajburiy | OrderService | |
| ↳ code | string | null | |
| ↳ title | string | null | |
| pricemajburiy | Price | |
| ↳ amountmajburiy | string | Chegirmali narx, so'm (string — suzuvchi nuqta xatosiz) |
| ↳ amount_centsmajburiy | integer | Chegirmali narx, tiyin |
| ↳ retail_amountmajburiy | string | Saytdagi chakana narx, so'm |
| ↳ retail_amount_centsmajburiy | integer | |
| ↳ discount_percentmajburiy | string | Qo'llangan chegirma, % |
| ↳ currency | "UZS" | standart: UZS |
| created_atmajburiy | string | format: date-time |
| expires_atmajburiy | string | Shu vaqtgacha SMS kelmasa buyurtma expired bo'ladi va pul qaytadiformat: date-time |
| completed_at | string | null | format: date-time |
curl 'https://api.milliysavdo.uz/v1/orders/ord_test_14' \
-H "Authorization: Bearer $MILLIYSAVDO_API_KEY"{
"id": "ord_test_14",
"object": "order",
"mode": "test",
"status": "waiting_sms",
"phone": "+1888582997",
"sms_code": null,
"country": {
"id": 6,
"name": "United States",
"iso_code": null
},
"service": {
"code": "907",
"title": "Telegram"
},
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
},
"created_at": "2026-10-16T02:13:52.251868Z",
"expires_at": "2026-10-16T02:33:52.251868Z",
"completed_at": null
}{
"id": "ord_test_14",
"object": "order",
"mode": "test",
"status": "sms_received",
"phone": "+1888582997",
"sms_code": "636841",
"country": {
"id": 6,
"name": "United States",
"iso_code": null
},
"service": {
"code": "907",
"title": "Telegram"
},
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
},
"created_at": "2026-10-16T02:13:52.251868Z",
"expires_at": "2026-10-16T02:33:52.251868Z",
"completed_at": "2026-10-16T02:13:52.301158Z"
}{
"type": "https://api.milliysavdo.uz/docs/errors#not_found",
"title": "Topilmadi",
"status": 404,
"detail": "Buyurtma topilmadi",
"code": "not_found",
"request_id": "req_6e73e3f1328ea25dd4272531"
}Buyurtmalar
Bekor qilish (pul qaytadi)
/v1/orders/{order_id}/cancelFaqat waiting_sms holatida. SMS kelgan bo'lsa 409.
Bearer API kalitscope: orders:write
Parametrlar
| Nomi | Joyi | Turi | Tavsif |
|---|---|---|---|
| order_idmajburiy | path | string | ord_<n> (live) yoki ord_test_<n> (test)maxLength: 40 |
Javoblar
- 200Muvaffaqiyatli
Order - 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilingan
Problem - 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmagan
Problem - 404Not Found
Problem - 409Conflict
Problem - 422Validation Error
HTTPValidationError - 429Rate-limit yoki kvota oshdi (
Retry-Afterheaderiga qarang)Problem - 503Service Unavailable
Problem
Order obyekti maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
| idmajburiy | string | ord_<n> (live) yoki ord_test_<n> (test) |
| object | "order" | standart: order |
| modemajburiy | enum | testlive |
| statusmajburiy | enum | waiting_sms → sms_received | cancelled | expired | failed. Yakuniy holatlarda pul qaytarilgan (sms_received bundan mustasno).waiting_smssms_receivedcancelledexpiredfailed |
| phonemajburiy | string | |
| sms_code | string | null | |
| countrymajburiy | OrderCountry | |
| ↳ idmajburiy | integer | |
| ↳ name | string | null | |
| ↳ iso_code | string | null | |
| servicemajburiy | OrderService | |
| ↳ code | string | null | |
| ↳ title | string | null | |
| pricemajburiy | Price | |
| ↳ amountmajburiy | string | Chegirmali narx, so'm (string — suzuvchi nuqta xatosiz) |
| ↳ amount_centsmajburiy | integer | Chegirmali narx, tiyin |
| ↳ retail_amountmajburiy | string | Saytdagi chakana narx, so'm |
| ↳ retail_amount_centsmajburiy | integer | |
| ↳ discount_percentmajburiy | string | Qo'llangan chegirma, % |
| ↳ currency | "UZS" | standart: UZS |
| created_atmajburiy | string | format: date-time |
| expires_atmajburiy | string | Shu vaqtgacha SMS kelmasa buyurtma expired bo'ladi va pul qaytadiformat: date-time |
| completed_at | string | null | format: date-time |
curl -X POST 'https://api.milliysavdo.uz/v1/orders/ord_test_15/cancel' \
-H "Authorization: Bearer $MILLIYSAVDO_API_KEY"{
"id": "ord_test_15",
"object": "order",
"mode": "test",
"status": "cancelled",
"phone": "+1231407863",
"sms_code": null,
"country": {
"id": 6,
"name": "United States",
"iso_code": null
},
"service": {
"code": "907",
"title": "Telegram"
},
"price": {
"amount": "3842.44",
"amount_cents": 384244,
"retail_amount": "4269.38",
"retail_amount_cents": 426938,
"discount_percent": "10.00",
"currency": "UZS"
},
"created_at": "2026-10-16T02:13:52.318700Z",
"expires_at": "2026-10-16T02:33:52.318700Z",
"completed_at": "2026-10-16T02:13:52.343024Z"
}{
"type": "https://api.milliysavdo.uz/docs/errors#sms_already_received",
"title": "SMS kod allaqachon kelgan",
"status": 409,
"detail": "SMS kod allaqachon kelgan, bekor qilib bo'lmaydi",
"code": "sms_already_received",
"request_id": "req_e237cc97a1d76d93e1ac4323"
}