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

# Handling errors

> How idto reports success, no-record, and failure outcomes across every v2 endpoint, and where to look up a specific error code.

Every `/v2/verify/*` response carries the same three fields for figuring out what happened: `status`, `error_code`, and `billed`. Branch your integration on `error_code`, not on `message` text, `message` is written for a human and can change wording between releases without notice.

## The three fields

**status** `string`

`"success"` for any 2xx response, `"error"` for a raised, non-2xx response. There's no `"failed"` value in v2, a definitive no-match is still `"success"`, see below.

**error\_code** `string | null`

`null` on a full match. Set to an `IDTO_*` code on a no-record result or on a raised error. The code, not the HTTP status or the message, is what identifies the exact outcome.

**billed** `boolean`

Whether the call was charged. A call is charged when it finishes with a 2xx `status: "success"`, unless a verification session already pays for that step; every raised error is `false`. See [Billing](https://idto.mintlify.site/concepts/billing-consent.md#billing) for the rule and its cases.

## No-record is still success

The pattern most integrations trip on: a query that runs cleanly but finds nothing (an invalid PAN, a bank account that doesn't exist) is not an error. It's HTTP `200`, `status: "success"`, `data: null`, and `IDTO_202` in `error_code`. `billed` is `true`: the check still ran and still cost a credit.

```json theme={null}
{
  "status": "success",
  "message": "Record is invalid or does not exist.",
  "error_code": "IDTO_202",
  "data": null,
  "billed": true,
  "tranx_id": "8f14e45f-ceea-467e-bd93-4a2c11e0a1b2",
  "timestamp": "2026-09-14T10:15:30Z"
}
```

Treat this as a distinct, expected outcome in your application, alongside "matched" and "raised error", not as a failure to catch and retry.

## Raised errors

Anything that isn't a full match or a valid no-record result is a raised, non-2xx response: `status: "error"`, `billed: false`. The HTTP status tells you the category: `400` or `422` for a request to fix, `401`, `403` or `404` for credentials, `409` for a duplicate or in-flight request, `429` for a verification source limiting requests (`IDTO_006`) or used-up OTP attempts (`IDTO_206`), `503` for a transient condition worth retrying, and `500` for a problem on idto's side. `data`, `tranx_id` and `timestamp` are on most raised errors but not all; [Error response shapes](https://idto.mintlify.site/concepts/request-response.md#error-response-shapes) shows exactly what each kind of response carries.

```json theme={null}
{
  "status": "error",
  "message": "User consent is required to proceed.",
  "error_code": "IDTO_005",
  "data": null,
  "tranx_id": "8f14e45f-ceea-467e-bd93-4a2c11e0a1b2",
  "timestamp": "2026-09-14T10:15:30Z",
  "chargeble": "false",
  "user_consent": "false",
  "billed": false
}
```

## What to do with each outcome

| Outcome | Example codes | Retry? | Action |
| - | - | - | - |
| Full result | `null` | No | Use `data` |
| No record | `IDTO_202` | No | Show the user a clear "not found" and let them correct the input |
| Bad input | `IDTO_001`, `IDTO_005`, `IDTO_101`, `IDTO_102`, `IDTO_401`, `IDTO_402` | No | Fix the request; check [Input formats](https://idto.mintlify.site/reference/input-formats.md) |
| OTP problems | `IDTO_205`, `IDTO_206` | After user action | Ask for a new OTP |
| In flight or reused key | `IDTO_004`, `IDTO_010` | `IDTO_004` yes, later | See [Idempotency](https://idto.mintlify.site/concepts/idempotency.md) |
| Source limiting requests | `IDTO_006` | Yes, with backoff | See [Rate limits](https://idto.mintlify.site/concepts/rate-limits.md) |
| Transient | `IDTO_008`, `IDTO_103`, `IDTO_403` | Yes, with backoff | Same key, same body |
| Image | `IDTO_503`, `IDTO_204` | After a new image | Ask for a clearer, smaller image |
| idto side | `IDTO_007`, `IDTO_509`, `IDTO_609` | `IDTO_509` and `IDTO_609` once | Write to support with the `tranx_id` if it repeats |

```python theme={null}
def handle(response):
    body = response.json()
    code = body.get("error_code")
    if response.ok and code is None:
        return "verified", body["data"]
    if code == "IDTO_202":
        return "not_found", None
    if code in ("IDTO_006", "IDTO_008", "IDTO_103", "IDTO_403"):
        return "retry", None
    return "fix_request", body.get("message")
```

## Idempotent retries

Send an `Idempotency-Key` header on a `/v2/verify/*` request to make retrying that exact call safe. Replaying the same key with the same body returns the original result rather than running (and billing) the check again. Replaying the same key with a different body is rejected with `IDTO_010`. A request still in flight under the same key returns `IDTO_004`. See [Idempotency](https://idto.mintlify.site/concepts/idempotency.md).

## Full code reference

The complete `IDTO_*` table, every code, its HTTP status, its default message, and whether it's billed, lives on one page: [Error codes](https://idto.mintlify.site/reference/v2-error-codes.md). This page explains the pattern; that page is the lookup table.

Was this page helpful? Email us at [tech@idto.ai](mailto:tech@idto.ai?subject=Docs%20feedback%3A%20Handling%20errors) with the page link.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.