Responses and Error Codes

All responses are in JSON format. The HTTP status always reflects the result, so checking the status is enough, and the body can be parsed according to the format below.

Successful response

Data is in data, service info (pagination, refunds, retry flag) is in meta. The meta field is not always present.

JSON
{
    "data": {
        "id": "4f2a9c1e7b3d48a6c5e0f1d2b3",
        "status": "label_ready"
    },
    "meta": {
        "duplicate": false
    }
}

Error response

The code field is stable and intended for programs, message is for humans (text may change and depends on language). details exist for field validation errors: the key is the field name, the value is the reason.

JSON
{
    "error": {
        "code": "validation_failed",
        "message": "Check request fields",
        "details": {
            "parcel.weight_g": "Weight must be an integer greater than zero"
        }
    }
}

Response headers

NameDescription
X-Request-IdRequest number. Include it in support requests so we can quickly find the request in the logs. Present in every response.
X-RateLimit-LimitKey request limit per minute. Only for requests with a key.
X-RateLimit-RemainingHow many requests remain in the current minute.
Retry-AfterHow many seconds to wait before retrying the request. Sent with a 429 response.

Error codes

The main error indicator is error.code. One HTTP status can correspond to multiple codes.

HTTPCodeDescription
401unauthenticatedНет заголовка Authorization: Bearer <ключ>.
401invalid_keyKey is invalid, revoked, or expired. The response does not indicate whether the key exists.
403insufficient_scopeKey lacks the required permission, specified in error.details.required_scope.
403ip_not_allowedRequest came from an IP address not allowed for this key.
403test_key_cannot_buyTest key does not purchase labels or order pickups, use a live key.
404not_foundObject not found among your account's objects (order, address, invoice, webhook, member, or team invitation), or the order has no active pickup, or the method does not exist. Objects belonging to others appear as non-existent.
409conflictAction is currently not possible for this order (e.g., order cannot be canceled or pickup already ordered). Reason text in error.message.
409rate_expiredRate is outdated or calculated for a different parcel or route. Request rates again.
422validation_failedError in request fields. error.details specifies the reason for each field.
422idempotency_key_requiredMissing or invalid Idempotency-Key header: must be 16–64 characters A-Za-z0-9_-.
402insufficient_fundsInsufficient funds on balance. Please top up your balance and retry.
429rate_limitedKey request limit exceeded. Retry after the time specified in the Retry-After header.
502provider_errorThe carrier did not complete the operation. The money has been refunded automatically.
503provider_unavailableThe carrier is temporarily unavailable. Please try again later.
403owner_key_requiredКомандой может управлять только ключ, созданный владельцем аккаунта.
422idempotency_key_reusedЭтот Idempotency-Key уже использован для другого запроса: для нового запроса нужен новый ключ.

Money and units of measurement

Amounts are only in whole US dollar cents (price_cents), tariffs additionally include a string price like 41.20. Weight in grams, dimensions in millimeters. Dates and times in ISO 8601 format (UTC).

Versions

The version is specified in the URL (/v1). Within a version, we only add fields and methods, so ignore unfamiliar fields in responses. Incompatible changes are released in a new version.