Skip to main content
Every error uses the same envelope:
details can carry more fields specific to the venue. Ignore fields you do not recognize. details takes one of two shapes:
  • When the body, query or path failed validation, details is a list with one entry per problem: path names the field, with nested fields joined by . (such as venues.0), and message says what is wrong with it. error.message names the first problem as path: message, and adds how many more details lists.
  • Otherwise details is an object with the fields above, or it is left out.

Codes

Every code is one of VALIDATION_ERROR, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT, RATE_LIMITED, UPSTREAM_ERROR, INTERNAL_ERROR and FEATURE_DISABLED. The error schema in the OpenAPI spec also lists CONDITIONAL_SELL_REJECTED and CONDITIONAL_SELL_ACTIVE. They belong to conditional sells in the Lean app, and no /v1 endpoint returns them. New details.reason and details.venue_code values can appear without a new version; treat one you do not recognize by its HTTP status. See Versioning.

details.reason on 422

Never resend an order with a new client_order_id after a timeout, an error, or an unconfirmed status. Look it up by the original ID first. A venue outcome after placement is a 200 with the order’s status, not an error. See What placement returns.