Sapa Moto

Errors

problem+json with a stable code — the full catalogue, generated from the OpenAPI specification.

Errors are application/problem+json (RFC 9457) with the members your code should rely on:

422 Unprocessable Entity
{
  "type": "urn:sapa:problem:order_not_editable",
  "title": "Unprocessable Entity",
  "status": 422,
  "detail": "Этот заказ уже нельзя изменить таким образом",
  "code": "order_not_editable",
  "message": "Этот заказ уже нельзя изменить таким образом",
  "details": [
    { "field": "dropoff", "code": "order_not_editable", "message": "Адрес уже нельзя изменить" }
  ],
  "order_status": "picked_up",
  "editable": ["comment", "recipient_phone"],
  "request_id": "0192f1c3-9e8d-7f6a-b5c4-d3e2f1a0b9c8"
}
MemberMeaning
codestable machine code from the catalogue below — branch on it
messagetext for people: Russian by default, Kazakh with Accept-Language: kk; may change
details[]per-field problems: field (path like recipient.phone), its own code and message
request_idthe id of the request — the same as the X-Request-Id header; quote it to support
extra memberssome codes add data, e.g. order_id and order_url for duplicate_external_id

New codes may appear within v1 — treat an unknown code by its HTTP status.

Validation

400 validation_failed lists every invalid field:

400 Bad Request
{
  "status": 400,
  "code": "validation_failed",
  "message": "Проверьте поля запроса",
  "details": [
    { "field": "recipient.phone", "code": "invalid_phone", "message": "Телефон получателя: +7XXXXXXXXXX" },
    { "field": "external_id", "code": "not_blank", "message": "не должно быть пустым" }
  ],
  "request_id": "0192f1c3-9e8d-7f6a-b5c4-d3e2f1a0b9c8"
}

Isolation

Orders, quotes and webhook endpoints of other organizations — and of the other environment of your own organization — are always 404 not_found, never 403. Nobody can probe whether an id exists.

Error catalogue

Generated from the x-error-catalogue of the OpenAPI specification; the platform's tests keep it identical to the codes the API really returns.

HTTPCodeMeaningRetry
400validation_failedOne or more fields are invalid. Each entry of details[] names the field and its own code.
message: «Проверьте поля запроса»
no
400malformed_requestThe body is not valid JSON or a value has the wrong type.
message: «Тело запроса не удалось прочитать»
no
400bad_requestA parameter has an invalid value (for example a date that cannot be parsed).
message: «Некорректный запрос»
no
400invalid_cursorThe cursor was not taken from a previous next_cursor or was changed.
message: «Некорректный курсор пагинации»
no
400idempotency_key_invalidThe Idempotency-Key header must be 1–255 printable ASCII characters without spaces.
message: «Некорректный Idempotency-Key»
no
400batch_too_largeA batch carries more than 100 orders. Split it.
message: «Не больше 100 заказов за запрос»
no
400webhook_url_not_allowedWebhook URLs must use https and resolve to a public host.
message: «Адрес вебхука: только https и публичный хост»
no
401unauthorizedNo Authorization: Bearer header, an unknown key or a revoked key. A revoked key stops working within 60 seconds on every replica. Platform user tokens are not accepted by the Partner API.
message: «Требуется вход»
no
403forbiddenThe key lacks the scope this operation needs (orders.read, orders.write, points.read, finance.read, webhooks.manage).
message: «Недостаточно прав»
no
403api_key_ip_not_allowedThe key has an IP allowlist and the request came from another address.
message: «Запрос с адреса вне allowlist ключа»
no
403feature_disabledThe Partner API is not enabled for your organization yet. Contact your account manager.
message: «Функция недоступна»
no
403organization_not_activeLive orders need an active organization with a signed contract. Test keys keep working.
message: «Организация не активна: новые заказы и аренда не принимаются»
no
403live_keys_not_enabledLive keys are issued after the back-office enables live mode for your organization.
message: «Боевые ключи включает аккаунт-менеджер после чек-листа готовности интеграции»
no
403delivery_not_connectedDelivery is not part of your organization's contract.
message: «Модуль «Доставка» не подключён организации»
no
404not_foundNo such resource for your organization and the key's environment. Orders of other organizations are always 404, never 403.
message: «Не найдено»
no
404quote_not_foundThe quote_id does not exist for your organization and environment.
message: «Расчёт не найден»
no
409duplicate_external_idAn order with this external_id already exists in this environment. The problem carries order_id and order_url of the existing order — fetch it instead of creating a new one.
message: «Заказ с таким внешним номером уже есть»
no
409idempotency_conflictThe same Idempotency-Key was used within 24 hours with a different body. Use a new key for a new request.
message: «Idempotency-Key уже использован с другим запросом»
no
409idempotency_in_progressThe first request with this key is still being processed. Retry in a second.
message: «Запрос с этим Idempotency-Key ещё выполняется»
yes
409slot_fullThe chosen delivery slot has no capacity left. Pick another slot from GET /v1/slots.
message: «Слот заполнен»
no
409order_transition_invalidThe order is in a status where this action is not possible (for example ready on a delivered order).
message: «Недопустимый переход статуса заказа»
no
409api_key_limit_reachedAt most two active keys per environment (for rotation). Revoke one in the cabinet first.
message: «Уже есть два активных ключа этой среды: отзовите один»
no
409webhook_endpoint_limit_reachedAt most 10 webhook endpoints per environment.
message: «Не больше 10 адресов вебхуков на среду»
no
422out_of_zoneThe pickup or drop-off is outside the delivery zones.
message: «Адрес вне зоны доставки»
no
422quote_expiredThe quote is older than 10 minutes. Request a new quote; its price may differ.
message: «Срок действия расчёта истёк, запросите новый»
no
422order_not_editableAfter picked_up only comment and recipient_phone can change. details[].field lists the refused fields; the problem carries order_status and the still editable fields.
message: «Этот заказ уже нельзя изменить таким образом»
no
422order_not_cancellableThe order is final (delivered, returned, cancelled) or already failed / returning. The problem carries order_status.
message: «Заказ уже нельзя отменить»
no
422pickup_point_unavailableLive orders need the point_id of an active pickup point of your organization.
message: «Точка забора неактивна или недоступна»
no
422address_ambiguousThe address text could not be geocoded precisely. Send latitude and longitude.
message: «Адрес не найден точно — укажите точку на карте»
no
422cargo_too_largeThe cargo is too heavy or large for every available vehicle.
message: «Груз не помещается ни в один транспорт»
no
422cod_not_allowedCash on delivery is not enabled in your contract.
message: «Оплата при получении не разрешена договором»
no
422cod_limit_exceededThe cash-on-delivery amount is above the limit of your contract.
message: «Сумма к оплате выше лимита договора»
no
422window_invalidscheduled_at is missing, in the past or outside the working hours for a scheduled or slot order.
message: «Окно времени не подходит для типа заказа»
no
429rate_limitedMore than 20 requests per second with one key (the limit can be raised for your organization), or /track was called more often than once per 10 seconds for one order. Wait Retry-After seconds.
message: «Слишком много запросов, повторите позже»
yes
500internal_errorUnexpected error on our side. Retry with the same Idempotency-Key; quote request_id to support.
message: «Внутренняя ошибка, мы уже разбираемся»
yes
503partner_live_orders_unavailableLive orders are temporarily unavailable. The sandbox keeps working.
message: «Боевые заказы через API станут доступны с запуском модуля заказов (Д1); песочница работает»
yes

Reason codes

reason_code of cancellations, failed deliveries and reassignments (in history[], order.status_changed, order.failed). Unknown codes you send in POST /cancel are stored as other.

CodeKindMeaning
client_changed_mindcancelThe client changed their mind.
duplicatecancelDuplicate order.
out_of_stockcancelThe goods are out of stock.
no_couriercancelNo courier was found (no fee).
dispatcher_decisioncancelCancelled by a Sapa Moto dispatcher.
othercancelAny other reason. Unknown codes sent by you are stored as other with your code in the comment.
batteryreassignThe courier's battery ran low; the order goes back to searching.
no_connectionreassignThe courier lost connection; the order goes back to searching.
better_optionreassignA closer courier was found.
not_readyreassignThe order was not ready at the pickup point in time.
recipient_unreachablefailureThe recipient did not answer; the order returns to the pickup point.
wrong_addressfailureThe address is wrong.
refusedfailureThe recipient refused the order.
no_adult_documentfailureNo ID for an 18+ order.
no_paymentfailureCash on delivery was not paid.
damagedfailureThe goods were damaged.

These docs are built from the platform's OpenAPI specification. Download OpenAPI