> ## Documentation Index
> Fetch the complete documentation index at: https://lmn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> Error envelope, full code matrix, and per-code troubleshooting.

## Error response shape

All non-2xx responses share this envelope:

```json theme={null}
{
  "error": {
    "code": "past_order_cutoff",
    "message": "The order window for this auction closed at 2026-04-20T12:00:00+09:00.",
    "request_id": "req_8829374",
    "details": {
      "cutoff_at": "2026-04-20T12:00:00+09:00",
      "now": "2026-04-20T12:30:00+09:00"
    }
  }
}
```

**Branch on `error.code` only.** `error.message` is human-readable English and may evolve. `details` is structured supplementary info — fields vary per code.

`request_id` is also returned as the `X-Request-Id` response header. Include it in any support request.

## HTTP → code matrix

| HTTP | `error.code` values                                                                                                       |
| ---- | ------------------------------------------------------------------------------------------------------------------------- |
| 400  | `validation_error`, `missing_idempotency_key`, `missing_max_bid`, `invalid_cursor`, `mixed_source_pagination_unsupported` |
| 401  | `missing_api_key`, `invalid_api_key`                                                                                      |
| 403  | `ip_not_allowed`, `invalid_status_transition` (partner attempting LMN-owned transition)                                   |
| 404  | `vehicle_not_found`, `order_not_found`, `order_vehicle_snapshot_not_found`                                                |
| 409  | `invalid_status_transition`, `past_order_cutoff`, `duplicate_order`                                                       |
| 410  | `vehicle_unavailable`                                                                                                     |
| 422  | `idempotency_key_reused`                                                                                                  |
| 429  | `rate_limited`                                                                                                            |
| 500  | `internal_error`                                                                                                          |
| 503  | `dealer_upstream_unavailable`                                                                                             |

## Per-code troubleshooting

| Code                                  | HTTP      | Meaning                                                                                      | When                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | What to do                                                                                                                                                                                                                                                                                                         |
| ------------------------------------- | --------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `validation_error`                    | 400       | Request shape failed validation.                                                             | Bad enum, missing field, `model` without `make`, `ids` > 100, `from` without `to`.                                                                                                                                                                                                                                                                                                                                                                                    | Inspect `error.details.issues[].path`. Fix the request; do not retry as-is.                                                                                                                                                                                                                                        |
| `missing_idempotency_key`             | 400       | `Idempotency-Key` header absent on order creation.                                           | `POST /v1/orders` without header.                                                                                                                                                                                                                                                                                                                                                                                                                                     | Add UUID v4 header, retry.                                                                                                                                                                                                                                                                                         |
| `invalid_cursor`                      | 400       | Cursor invalid, expired, or sort-mismatched.                                                 | Resending a cursor after changing `sort=`.                                                                                                                                                                                                                                                                                                                                                                                                                            | Restart pagination from page 1 with the desired sort.                                                                                                                                                                                                                                                              |
| `missing_max_bid`                     | 400       | Auction vehicle requires `max_bid_amount_usd`.                                               | POST with null/omitted/below-listing bid.                                                                                                                                                                                                                                                                                                                                                                                                                             | Add `max_bid_amount_usd` (integer > 0, ≥ listing). Not required for buy-now.                                                                                                                                                                                                                                       |
| `missing_api_key`                     | 401       | `x-api-key` header absent.                                                                   | Any request without header.                                                                                                                                                                                                                                                                                                                                                                                                                                           | Add the header.                                                                                                                                                                                                                                                                                                    |
| `invalid_api_key`                     | 401       | Key not recognized, revoked, or wrong env.                                                   | Sandbox key against production URL, or revoked key.                                                                                                                                                                                                                                                                                                                                                                                                                   | Verify env (sandbox vs production); rotate if compromised.                                                                                                                                                                                                                                                         |
| `ip_not_allowed`                      | 403       | Source IP not in allowlist.                                                                  | Egress IP missing from per-env allowlist.                                                                                                                                                                                                                                                                                                                                                                                                                             | Email `integrations@lmnauto.com` to add IP. Check egress NAT stability.                                                                                                                                                                                                                                            |
| `invalid_status_transition`           | 403 / 409 | Requested transition not permitted.                                                          | **403** = partner attempted an LMN-owned status (`inspection_in_progress`, `inspection_ready`, `acquiring`, `secured`, `export_processing`, `in_transit`); `details.reason: "partner_not_authorized"`. **409** = sequence violation (e.g., `delivered` from non-`customs`, `DELETE` from non-`placed`); `details.reason: "out_of_sequence"`. `details.current_status` set in both cases.                                                                              | Re-fetch `GET /v1/orders/{id}` to see current state. Only use partner-permitted transitions: `in_transit → customs`, `customs → delivered`.                                                                                                                                                                        |
| `vehicle_not_found`                   | 404       | Unknown or unavailable vehicle ID.                                                           | Stale ID, wrong-env ID, or a dealer (`encar_*`) detail page whose upstream advertisement is no longer active / marked `SOLD` or `WAIT`.                                                                                                                                                                                                                                                                                                                               | Refresh the listing; confirm correct base URL. For dealer cars, treat this as no longer available to buy and remove or disable the listing in your UI. Cars you have **already ordered** are exempt — their detail still resolves from your stored order snapshot, so a purchased vehicle won't return this error. |
| `order_not_found`                     | 404       | Unknown order ID for this key.                                                               | Wrong env, cross-key ID, or deleted.                                                                                                                                                                                                                                                                                                                                                                                                                                  | Confirm correct base URL; the ID belongs to your account.                                                                                                                                                                                                                                                          |
| `order_vehicle_snapshot_not_found`    | 404       | Order exists, but no purchased-vehicle snapshot is stored.                                   | `GET /v1/orders/{id}/vehicle` for a historical order created before snapshot storage.                                                                                                                                                                                                                                                                                                                                                                                 | Use live `GET /v1/vehicles/{vehicle_id}` only if the listing still exists; otherwise contact LMN for manual recovery.                                                                                                                                                                                              |
| `past_order_cutoff`                   | 409       | POST after the auction's cutoff.                                                             | `auction_date − N min` (your integration's lead time; default 1440 = 24h) already passed.                                                                                                                                                                                                                                                                                                                                                                             | Inform dealer that the order window is closed.                                                                                                                                                                                                                                                                     |
| `duplicate_order`                     | 409       | Active order already exists for this vehicle.                                                | Repeat POST while a prior order is not terminal. `details.existing_order_id` references it.                                                                                                                                                                                                                                                                                                                                                                           | Redirect user to existing order page. Do not auto-retry.                                                                                                                                                                                                                                                           |
| `idempotency_key_reused`              | 422       | Same `Idempotency-Key` with a different `vehicle_id`.                                        | Client-library bug reusing keys across logical requests.                                                                                                                                                                                                                                                                                                                                                                                                              | Inspect `details.original_vehicle_id`. Generate a fresh key per new order.                                                                                                                                                                                                                                         |
| `vehicle_unavailable`                 | 410       | Vehicle no longer available.                                                                 | Dealer or buy-now listing disappeared before LMN could complete the purchase.                                                                                                                                                                                                                                                                                                                                                                                         | Move order to `failed` in UI once the order snapshot reflects `failure_reason: "vehicle_unavailable"`; notify dealer.                                                                                                                                                                                              |
| `rate_limited`                        | 429       | Per-key rate limit exceeded.                                                                 | Burst exceeded sliding-window bucket.                                                                                                                                                                                                                                                                                                                                                                                                                                 | Respect `Retry-After` header; client-side exponential backoff.                                                                                                                                                                                                                                                     |
| `internal_error`                      | 500       | Server-side failure.                                                                         | Rare; LMN on-call is paged automatically. Body carries only a generic message — no stack traces.                                                                                                                                                                                                                                                                                                                                                                      | Retry with exponential backoff (3 tries). If persistent, share `request_id` with support.                                                                                                                                                                                                                          |
| `mixed_source_pagination_unsupported` | 400       | `cursor` passed with mixed auction+dealer `source`.                                          | Trying to paginate beyond page 1 on a query like `source=glovis,dealer&cursor=…`.                                                                                                                                                                                                                                                                                                                                                                                     | Restart pagination per source — issue separate requests with `source=glovis` and `source=dealer`. The first page of a mixed query is supported; deeper iteration is not.                                                                                                                                           |
| `dealer_upstream_unavailable`         | 503       | A dealer upstream (Encar or Danawa) is unreachable or returned an unexpected response shape. | Transient dealer-source outage, network blip, bot-protection interstitial, or extractor drift. Mixed requests degrade gracefully with `X-LMN-Partial-Dealer-Unavailable: <csv>` — a comma-separated list of the dealer source names that failed (e.g. `encar`, `danawa`, or `encar,danawa`) — instead of this error; a pure dealer request fails with 503 only when **all** dealer sources are down (one source down still returns the survivor's rows + the header). | Retry after a short backoff (5–30s). If persistent (> 5 min for a single ID, > 2 min for list), include `request_id` and the failing dealer query in a support note — auction requests are unaffected during dealer outages.                                                                                       |
