Orders

This section describes the APIs for calculating the delivery price, creating an order and retrieving the status history of a shipment.

1. General

All requests are sent to {BASE_URL}/api/v2/orders/.... The base URL and token are provided by Starex.

Authorization: Bearer {TOKEN}
Content-Type: application/json
Accept: application/json
Accept-Language: en
All methods in this section require the “Orders” service to be enabled for your account. Otherwise error -401 is returned.

Methods:

MethodEndpointPurpose
POST /api/v2/orders/calculate Calculate the delivery price
POST /api/v2/orders/create Create an order (shipment)
GET /api/v2/orders/trace Status history of a shipment
Amounts are returned in tiyin. For example 4500000 means 45,000 UZS.

2. Delivery type

The service field defines where the shipment is delivered and which other fields become required.

serviceTypeRequired fields
1 To the door (courier delivers to the address) receiver_district_id + receiver_address
2 To a pickup point (picked up at a branch) receiver_branch_id

District and branch IDs come from the Dictionaries section.

With service = 1 the field receiver_branch_id is ignored, and with service = 2 the field receiver_district_id is ignored.

3. Price calculation

Lets you check the delivery price before creating an order.

POST {BASE_URL}/api/v2/orders/calculate

Request parameters
ParameterTypeRequiredDescription
sender_district_idintegerYesSender district ID
sender_addressstringNoSender address
serviceintegerYes1 — to the door, 2 — to a pickup point
receiver_district_idintegerYes for service=1Receiver district ID
receiver_branch_idintegerYes for service=2Branch (pickup point) ID
receiver_addressstringNoReceiver address
weightnumberYesWeight in kg (for example 1.5)
Request example
POST {BASE_URL}/api/v2/orders/calculate
Authorization: Bearer {TOKEN}
Content-Type: application/json
{
  "sender_district_id": 12,
  "sender_address": "Amir Temur street, 1",
  "receiver_district_id": 45,
  "receiver_address": "Mustaqillik street, 20",
  "weight": 1.5,
  "service": 1
}
Response (200)
{
  "success": true,
  "data": {
    "price": 4500000,
    "from_town": { "code": 3922, "name": "TASHKENT" },
    "to_town": { "code": 3969, "name": "SAMARKAND" },
    "mass": 1.5,
    "service": { "code": 1, "name": "Courier delivery" }
  }
}
FieldTypeDescription
priceintegerDelivery price, in tiyin
from_town.codeinteger|nullSender city code (Starex internal code)
from_town.namestring|nullSender city name
to_town.codeinteger|nullReceiver city code
to_town.namestring|nullReceiver city name
massnumber|nullWeight used for the calculation (kg)
service.codeinteger|nullDelivery type code
service.namestring|nullDelivery type name
With service = 2 (pickup point) to_town may come back empty — in that case the destination is defined by the branch.

4. Creating an order

Creates a new shipment and returns its barcode.

POST {BASE_URL}/api/v2/orders/create

Request parameters
ParameterTypeRequiredDescription
sender_district_idintegerYesSender district ID
sender_personstringNoSender name
sender_phonestringNoSender phone
sender_addressstringNoSender address
serviceintegerYes*1 — to the door, 2 — to a pickup point
receiver_district_idintegerYes for service=1Receiver district ID
receiver_branch_idintegerYes for service=2Branch (pickup point) ID
receiver_personstringYes**Receiver name (individual)
receiver_companystringYes**Receiver company name
receiver_phonestringYesReceiver phone
receiver_addressstringNoReceiver address (needed for door delivery)
weightnumberNoWeight, kg

* Technically the field may be omitted, but then the shipment goes out without a destination — always send 1 or 2.

** At least one of receiver_person or receiver_company must be provided.

Important: do not send receiver_person and receiver_company at the same time — if both are present, the receiver name will not reach the shipment. Send only receiver_person for individuals and only receiver_company for companies.
Request example (to the door)
POST {BASE_URL}/api/v2/orders/create
Authorization: Bearer {TOKEN}
Content-Type: application/json
{
  "sender_district_id": 12,
  "sender_person": "Ali Valiyev",
  "sender_phone": "998901234567",
  "sender_address": "Amir Temur street, 1",
  "receiver_district_id": 45,
  "receiver_person": "Vali Aliyev",
  "receiver_phone": "998907654321",
  "receiver_address": "Mustaqillik street, 20",
  "weight": 1.5,
  "service": 1
}
Request example (to a pickup point)
{
  "sender_district_id": 12,
  "sender_person": "Ali Valiyev",
  "sender_phone": "998901234567",
  "receiver_branch_id": 7,
  "receiver_person": "Vali Aliyev",
  "receiver_phone": "998907654321",
  "weight": 1.5,
  "service": 2
}
Response (200)
{
  "success": true,
  "data": {
    "order_code": "AB123456789UZ",
    "price": 4500000,
    "api_response": {
      "orderNo": "123456",
      "barcode": "AB123456789UZ",
      "error": 0,
      "errorMessage": null,
      "errorMessageRu": null,
      "orderPrice": 45000
    }
  }
}
FieldTypeDescription
order_codestring|nullBarcode — used in all further requests and in the webhook
priceinteger|nullShipment price, in tiyin
api_response.orderNostring|nullInternal shipment number
api_response.barcodestring|nullBarcode
api_response.errorinteger|null0 — success, any other value — error
api_response.errorMessagestring|nullError message
api_response.errorMessageRustring|nullError message in Russian
api_response.orderPricenumber|nullPrice (in UZS, not tiyin)
Warning: even when the external system returns an error, the response comes back with "success": true. Always check data.api_response.error: 0 means the shipment was created, anything else means it was not.

Example of a failed creation:

{
  "success": true,
  "data": {
    "order_code": null,
    "price": null,
    "api_response": {
      "orderNo": null,
      "barcode": null,
      "error": 1,
      "errorMessage": "Wrong town code",
      "errorMessageRu": "Неверный код города",
      "orderPrice": null
    }
  }
}
Once created, the order enters the Starex system and its statuses start changing. Track them with the shipment statuses request or via webhook.

5. Shipment statuses

Returns the status history of a single shipment by its barcode.

GET {BASE_URL}/api/v2/orders/trace

ParameterTypeRequiredDescription
barcodestringYesShipment barcode
GET {BASE_URL}/api/v2/orders/trace?barcode=AB123456789UZ
Authorization: Bearer {TOKEN}
Accept: application/json
Response (200)
{
  "success": true,
  "data": {
    "barcode": "AB123456789UZ",
    "date": "2026-06-10 09:00:00",
    "weight": 1.5,
    "recipient": "Vali Aliyev",
    "trace": [
      { "code": 1, "name": "Новый",     "advanced": "NEW",      "statetime": "2026-06-10 09:00:00", "branch": "Tashkent central warehouse", "description": "Order accepted" },
      { "code": 9, "name": "Доставлен", "advanced": "COMPLETE", "statetime": "2026-06-15 14:30:00", "branch": "Samarkand branch",           "description": "Delivered to the recipient" }
    ]
  }
}
FieldTypeDescription
barcodestringShipment barcode
datestring|nullAcceptance date and time
weightnumber|nullWeight (kg)
recipientstring|nullRecipient
trace[]arrayStatus history (ascending by time)
trace[].codeintegerStatus code (section 6)
trace[].namestring|nullStatus name (in Russian)
trace[].advancedstring|nullLanguage-neutral mnemonic code (for example NEW)
trace[].statetimestring|nullStatus timestamp
trace[].branchstring|nullName of the branch or warehouse where the status was recorded
trace[].descriptionstring|nullAdditional comment for the status

If the barcode is not found:

{
  "success": false,
  "error": {
    "code": -404,
    "message": "Data not found"
  }
}

6. Status codes

Every shipment status is identified by a numeric code. The same codes are used in three places:

The dictionary request resolves the codes:

GET {BASE_URL}/api/v2/dictionaries/states

{
  "success": true,
  "data": [
    { "code": 0, "name": "Ожидает синхронизации", "advanced": "AWAITING_SYNC" },
    { "code": 1, "name": "Новый",                  "advanced": "NEW" },
    { "code": 9, "name": "Доставлен",              "advanced": "COMPLETE" }
  ]
}
FieldTypeDescription
codeintegerStatus code
namestring|nullStatus name (in Russian)
advancedstring|nullStable, language-neutral mnemonic code
Important: the status list is not fixed — new statuses may be added and existing ones may change. Do not hard-code the list; fetch it from the API and cache it.

7. Errors

On failure the response contains success = false and an error object:

{
  "success": false,
  "error": {
    "code": -2006,
    "message": "District is required"
  }
}
CodeHTTPReason
422422Field validation (for example, missing receiver_phone)
401401Token missing or invalid
-423423Account is locked
-401200No access to the “Orders” service
-500200Access settings for your account are incomplete — contact Starex
-2001200Sender district not found
-2002200Receiver district not found
-2004200Receiver branch not found
-2005200Neither receiver_person nor receiver_company was sent
-2006200service=1 but receiver_district_id is missing
-2007200service=2 but receiver_branch_id is missing
-404200Shipment not found (for trace)
100200Unexpected internal error
The error text is returned in the language from the Accept-Language header: uz, ru or en.