Asosiy kontentga o'tish
MilliySavdo

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

Barcha javob misollari sandbox muhitidan olingan haqiqiy javoblar. Kodlarda kalit o'rniga $MILLIYSAVDO_API_KEY muhit o'zgaruvchisi ishlatilgan — kalitni hech qachon kodga yozmang.

Akkaunt

Kalit, limitlar va balans

Akkaunt

Kalit va limitlar haqida

GET/v1/me

Kalit qaysi rejimda (test/live), qaysi ruxsatlar bilan ishlayotgani va amaldagi limitlar.

Bearer API kalitscope: catalog:read

Javoblar

  • 200MuvaffaqiyatliMe
  • 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilinganProblem
  • 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmaganProblem
  • 429Rate-limit yoki kvota oshdi (Retry-After headeriga qarang)Problem
Me obyekti maydonlari
Me maydonlari
MaydonTuriTavsif
object"api_key_info"standart: api_key_info
modemajburiyenumtestlive
keymajburiyKeyInfo
↳ namemajburiystring
↳ prefixmajburiystringKalitning maskalangan ko'rinishi
↳ modemajburiyenumtestlive
↳ scopesmajburiystring[]
↳ expires_atstring | nullformat: date-time
accountmajburiyobjecttier (demo|production) va kompaniya nomi
limitsmajburiyLimits
↳ rate_limit_per_minutemajburiyinteger
↳ daily_request_quotamajburiyinteger
↳ monthly_request_quotamajburiyinteger
↳ daily_order_limitmajburiyinteger
↳ max_active_ordersmajburiyinteger
↳ discount_percentmajburiystring
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

GET/v1/balance

Live: MilliySavdo hisobingiz balansi (sayt bilan umumiy). Test: virtual balans, kamaymaydi.

Bearer API kalitscope: balance:read

Javoblar

  • 200MuvaffaqiyatliBalance
  • 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilinganProblem
  • 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmaganProblem
  • 429Rate-limit yoki kvota oshdi (Retry-After headeriga qarang)Problem
Balance obyekti maydonlari
Balance maydonlari
MaydonTuriTavsif
object"balance"standart: balance
modemajburiyenumtestlive
amountmajburiystring
amount_centsmajburiyinteger
currency"UZS"standart: UZS
notestring | nullTest 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

GET/v1/countries

Hozir raqam olish mumkin bo'lgan davlatlar (mashhurlari birinchi).

Bearer API kalitscope: catalog:read

Javoblar

  • 200MuvaffaqiyatliListResponse_Country_
  • 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilinganProblem
  • 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmaganProblem
  • 429Rate-limit yoki kvota oshdi (Retry-After headeriga qarang)Problem
ListResponse_Country_ obyekti maydonlari
ListResponse_Country_ maydonlari
MaydonTuriTavsif
object"list"standart: list
datamajburiyCountry[]
↳ idmajburiyinteger
↳ namemajburiystring
↳ iso_codestring | null
↳ phone_codemajburiystring
↳ flagstring | null
↳ popularbooleanstandart: false
has_moremajburiybooleanYana sahifa bormi
next_cursorstring | nullKeyingi 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

GET/v1/services

Narx — sizning chegirmangiz qo'llangan holda. next_cursor — keyingi offset.

Bearer API kalitscope: catalog:read

Parametrlar

NomiJoyiTuriTavsif
country_idmajburiyqueryinteger/v1/countries dagi idminimum: 1
qquerystring | nullNomi yoki kodi bo'yicha qidiruvmaxLength: 64
categoryquerystring | nullmaxLength: 32
limitqueryintegerminimum: 1 · maximum: 200 · standart: 100
offsetqueryintegerminimum: 0 · maximum: 100000 · standart: 0

Javoblar

  • 200MuvaffaqiyatliListResponse_Service_
  • 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilinganProblem
  • 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmaganProblem
  • 422Validation ErrorHTTPValidationError
  • 429Rate-limit yoki kvota oshdi (Retry-After headeriga qarang)Problem
ListResponse_Service_ obyekti maydonlari
ListResponse_Service_ maydonlari
MaydonTuriTavsif
object"list"standart: list
datamajburiyService[]
↳ codemajburiystring
↳ titlemajburiystring
↳ categorystring | null
↳ country_idmajburiyinteger
↳ logo_urlstring | null
↳ in_stockmajburiyintegerTaxminiy zaxira (provayder ma'lumoti)
↳ availablemajburiybooleanfalse — provayder tomonida vaqtincha yopiq
↳ pricemajburiyPrice
↳ amountmajburiystringChegirmali narx, so'm (string — suzuvchi nuqta xatosiz)
↳ amount_centsmajburiyintegerChegirmali narx, tiyin
↳ retail_amountmajburiystringSaytdagi chakana narx, so'm
↳ retail_amount_centsmajburiyinteger
↳ discount_percentmajburiystringQo'llangan chegirma, %
↳ currency"UZS"standart: UZS
has_moremajburiybooleanYana sahifa bormi
next_cursorstring | nullKeyingi 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

GET/v1/prices

Eng arzonidan boshlab saralangan.

Bearer API kalitscope: catalog:read

Parametrlar

NomiJoyiTuriTavsif
service_codemajburiyquerystringmaxLength: 50
limitqueryintegerminimum: 1 · maximum: 200 · standart: 50

Javoblar

  • 200MuvaffaqiyatliListResponse_ServicePrice_
  • 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilinganProblem
  • 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmaganProblem
  • 422Validation ErrorHTTPValidationError
  • 429Rate-limit yoki kvota oshdi (Retry-After headeriga qarang)Problem
ListResponse_ServicePrice_ obyekti maydonlari
ListResponse_ServicePrice_ maydonlari
MaydonTuriTavsif
object"list"standart: list
datamajburiyServicePrice[]
↳ countrymajburiyOrderCountry
↳ idmajburiyinteger
↳ namestring | null
↳ iso_codestring | null
↳ servicemajburiyOrderService
↳ codestring | null
↳ titlestring | null
↳ in_stockmajburiyinteger
↳ availablemajburiyboolean
↳ pricemajburiyPrice
↳ amountmajburiystringChegirmali narx, so'm (string — suzuvchi nuqta xatosiz)
↳ amount_centsmajburiyintegerChegirmali narx, tiyin
↳ retail_amountmajburiystringSaytdagi chakana narx, so'm
↳ retail_amount_centsmajburiyinteger
↳ discount_percentmajburiystringQo'llangan chegirma, %
↳ currency"UZS"standart: UZS
has_moremajburiybooleanYana sahifa bormi
next_cursorstring | nullKeyingi 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)

POST/v1/orders

Live 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

NomiJoyiTuriTavsif
Idempotency-Keyheaderstring | nullmaxLength: 80

So'rov body application/json · OrderCreate

So'rov body maydonlari
MaydonTuriTavsif
country_idmajburiyintegerGET /v1/countries dagi idmin: 1
service_codemajburiystringminLength: 1 · maxLength: 50 · pattern: ^[A-Za-z0-9_.-]+$
sandbox_scenarioenum | nullFaqat 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 buyurtmaOrder
  • 201MuvaffaqiyatliOrder
  • 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilinganProblem
  • 402Balans yetarli emasProblem
  • 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmaganProblem
  • 404Xizmat/davlat topilmadiProblem
  • 409Raqamlar tugagan / xizmat vaqtincha yopiq / parallel so'rovProblem
  • 422Validatsiya xatosi yoki Idempotency-Key qayta ishlatilganProblem
  • 429Rate-limit yoki kvota oshdi (Retry-After headeriga qarang)Problem
Order obyekti maydonlari
Order maydonlari
MaydonTuriTavsif
idmajburiystringord_<n> (live) yoki ord_test_<n> (test)
object"order"standart: order
modemajburiyenumtestlive
statusmajburiyenumwaiting_sms → sms_received | cancelled | expired | failed. Yakuniy holatlarda pul qaytarilgan (sms_received bundan mustasno).waiting_smssms_receivedcancelledexpiredfailed
phonemajburiystring
sms_codestring | null
countrymajburiyOrderCountry
↳ idmajburiyinteger
↳ namestring | null
↳ iso_codestring | null
servicemajburiyOrderService
↳ codestring | null
↳ titlestring | null
pricemajburiyPrice
↳ amountmajburiystringChegirmali narx, so'm (string — suzuvchi nuqta xatosiz)
↳ amount_centsmajburiyintegerChegirmali narx, tiyin
↳ retail_amountmajburiystringSaytdagi chakana narx, so'm
↳ retail_amount_centsmajburiyinteger
↳ discount_percentmajburiystringQo'llangan chegirma, %
↳ currency"UZS"standart: UZS
created_atmajburiystringformat: date-time
expires_atmajburiystringShu vaqtgacha SMS kelmasa buyurtma expired bo'ladi va pul qaytadiformat: date-time
completed_atstring | nullformat: 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

GET/v1/orders

Faqat API orqali olingan buyurtmalar, yangilari birinchi.

Bearer API kalitscope: orders:read

Parametrlar

NomiJoyiTuriTavsif
statusquerystring | nullwaiting_sms | sms_received | cancelled | expired | failed
limitqueryintegerminimum: 1 · maximum: 100 · standart: 20
starting_afterquerystring | nullOldingi sahifadagi next_cursormaxLength: 40

Javoblar

  • 200MuvaffaqiyatliListResponse_Order_
  • 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilinganProblem
  • 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmaganProblem
  • 422Validation ErrorHTTPValidationError
  • 429Rate-limit yoki kvota oshdi (Retry-After headeriga qarang)Problem
ListResponse_Order_ obyekti maydonlari
ListResponse_Order_ maydonlari
MaydonTuriTavsif
object"list"standart: list
datamajburiyOrder[]
↳ idmajburiystringord_<n> (live) yoki ord_test_<n> (test)
↳ object"order"standart: order
↳ modemajburiyenumtestlive
↳ statusmajburiyenumwaiting_sms → sms_received | cancelled | expired | failed. Yakuniy holatlarda pul qaytarilgan (sms_received bundan mustasno).waiting_smssms_receivedcancelledexpiredfailed
↳ phonemajburiystring
↳ sms_codestring | null
↳ countrymajburiyOrderCountry
↳ idmajburiyinteger
↳ namestring | null
↳ iso_codestring | null
↳ servicemajburiyOrderService
↳ codestring | null
↳ titlestring | null
↳ pricemajburiyPrice
↳ amountmajburiystringChegirmali narx, so'm (string — suzuvchi nuqta xatosiz)
↳ amount_centsmajburiyintegerChegirmali narx, tiyin
↳ retail_amountmajburiystringSaytdagi chakana narx, so'm
↳ retail_amount_centsmajburiyinteger
↳ discount_percentmajburiystringQo'llangan chegirma, %
↳ currency"UZS"standart: UZS
↳ created_atmajburiystringformat: date-time
↳ expires_atmajburiystringShu vaqtgacha SMS kelmasa buyurtma expired bo'ladi va pul qaytadiformat: date-time
↳ completed_atstring | nullformat: date-time
has_moremajburiybooleanYana sahifa bormi
next_cursorstring | nullKeyingi 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

GET/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

NomiJoyiTuriTavsif
order_idmajburiypathstringord_<n> (live) yoki ord_test_<n> (test)maxLength: 40

Javoblar

  • 200MuvaffaqiyatliOrder
  • 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilinganProblem
  • 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmaganProblem
  • 404Not FoundProblem
  • 422Validation ErrorHTTPValidationError
  • 429Rate-limit yoki kvota oshdi (Retry-After headeriga qarang)Problem
Order obyekti maydonlari
Order maydonlari
MaydonTuriTavsif
idmajburiystringord_<n> (live) yoki ord_test_<n> (test)
object"order"standart: order
modemajburiyenumtestlive
statusmajburiyenumwaiting_sms → sms_received | cancelled | expired | failed. Yakuniy holatlarda pul qaytarilgan (sms_received bundan mustasno).waiting_smssms_receivedcancelledexpiredfailed
phonemajburiystring
sms_codestring | null
countrymajburiyOrderCountry
↳ idmajburiyinteger
↳ namestring | null
↳ iso_codestring | null
servicemajburiyOrderService
↳ codestring | null
↳ titlestring | null
pricemajburiyPrice
↳ amountmajburiystringChegirmali narx, so'm (string — suzuvchi nuqta xatosiz)
↳ amount_centsmajburiyintegerChegirmali narx, tiyin
↳ retail_amountmajburiystringSaytdagi chakana narx, so'm
↳ retail_amount_centsmajburiyinteger
↳ discount_percentmajburiystringQo'llangan chegirma, %
↳ currency"UZS"standart: UZS
created_atmajburiystringformat: date-time
expires_atmajburiystringShu vaqtgacha SMS kelmasa buyurtma expired bo'ladi va pul qaytadiformat: date-time
completed_atstring | nullformat: 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)

POST/v1/orders/{order_id}/cancel

Faqat waiting_sms holatida. SMS kelgan bo'lsa 409.

Bearer API kalitscope: orders:write

Parametrlar

NomiJoyiTuriTavsif
order_idmajburiypathstringord_<n> (live) yoki ord_test_<n> (test)maxLength: 40

Javoblar

  • 200MuvaffaqiyatliOrder
  • 401Kalit yo'q, yaroqsiz, muddati tugagan yoki bekor qilinganProblem
  • 403Scope yetarli emas, akkaunt to'xtatilgan yoki IP ruxsat etilmaganProblem
  • 404Not FoundProblem
  • 409ConflictProblem
  • 422Validation ErrorHTTPValidationError
  • 429Rate-limit yoki kvota oshdi (Retry-After headeriga qarang)Problem
  • 503Service UnavailableProblem
Order obyekti maydonlari
Order maydonlari
MaydonTuriTavsif
idmajburiystringord_<n> (live) yoki ord_test_<n> (test)
object"order"standart: order
modemajburiyenumtestlive
statusmajburiyenumwaiting_sms → sms_received | cancelled | expired | failed. Yakuniy holatlarda pul qaytarilgan (sms_received bundan mustasno).waiting_smssms_receivedcancelledexpiredfailed
phonemajburiystring
sms_codestring | null
countrymajburiyOrderCountry
↳ idmajburiyinteger
↳ namestring | null
↳ iso_codestring | null
servicemajburiyOrderService
↳ codestring | null
↳ titlestring | null
pricemajburiyPrice
↳ amountmajburiystringChegirmali narx, so'm (string — suzuvchi nuqta xatosiz)
↳ amount_centsmajburiyintegerChegirmali narx, tiyin
↳ retail_amountmajburiystringSaytdagi chakana narx, so'm
↳ retail_amount_centsmajburiyinteger
↳ discount_percentmajburiystringQo'llangan chegirma, %
↳ currency"UZS"standart: UZS
created_atmajburiystringformat: date-time
expires_atmajburiystringShu vaqtgacha SMS kelmasa buyurtma expired bo'ladi va pul qaytadiformat: date-time
completed_atstring | nullformat: 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"
}