Starex Client

API for working with shipments

General rules

Base URL

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

Authorization

Every request must carry a Bearer token. The token is issued to you personally by Starex — do not share it.

Authorization: Bearer {TOKEN}
Accept: application/json

Token-related errors:

CaseHTTPerror.code
Token not provided401401
Token is invalid401401
Account is locked423-423
No access to the service200-401
Each service (Orders, Webhook) is enabled separately. If you do not have access to the required service, the request returns error -401 — in that case contact Starex.

Language

Response texts (error messages, dictionary names) are controlled by the Accept-Language header. Supported values: uz, ru, en.

Important: dictionaries (regions, districts, branches) are available in uz and ru only. Requesting them with en returns error -210.

Response format

Successful response:

{
  "success": true,
  "data": { }
}

Error:

{
  "success": false,
  "error": {
    "code": -401,
    "message": "You do not have permission to perform this action"
  }
}
Note: business-logic errors (district not found, no permission and so on) may also come back with HTTP 200. Always check the success field, not just the HTTP status.

A validation error (HTTP 422) additionally contains details:

{
  "success": false,
  "error": {
    "code": 422,
    "message": "The given data was invalid.",
    "details": {
      "receiver_phone": ["The receiver phone field is required."]
    }
  }
}

Error codes

CodeMeaning
422Field validation error (see details)
401Token missing or invalid
-401No permission for this action
-423Account is locked
-404Data not found
-210Selected language is not supported for this operation
-500Insufficient data to continue (access settings are incomplete)
-2001Sender district not found
-2002Receiver district not found
-2004Receiver branch not found
-2005Receiver company or person name must be provided
-2006District is required
-2007Branch is required
100Unexpected internal error

Getting started

  1. Starex issues your token and enables the services you need.
  2. If you need webhooks, you provide Starex with your webhook URL.
  3. Fetch district and branch IDs from the dictionaries.
  4. Use the Orders section to calculate the price and create a shipment.
  5. Track status changes via webhook or the orders/trace request.