> ## 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.

# Billing & Consent

> When a call is billed, when it isn't, and the exact request field that enforces user consent.

## Billing

One rule covers every product, v1 and v2: **a call is charged when it finishes with a 2xx response whose `status` is `"success"`, unless a verification session already pays for that step.**

On v2 that covers two outcomes, both HTTP 200 and both `billed: true`:

* A **full match**: `error_code` is `null` and `data` is populated.
* A **definitive no-record result**: `error_code` is `IDTO_202` and `data` is `null`. The lookup still ran to completion, it just didn't find anything, and that is a billable outcome, not a free one.

Every raised error (any non-2xx response) has `status: "error"` and is never charged. That includes `IDTO_204` (no readable Aadhaar QR, HTTP 422): it is a raised error like any other, not an exception to the rule.

Three cases follow from the rule and are worth knowing:

1. **Session-paid step.** A call that carries the `workflow_session_token` of an in-progress verification session, for a step that session charges for, returns a 2xx `success` with `billed: false`. The session step is charged instead of the call. If the session is priced per call, or has ended or expired, the call is charged normally.
2. **Idempotent replay.** A retry with the same `Idempotency-Key` returns a copy of the stored first response, including its `billed` value, and is not charged again. See [Idempotency](https://idto.mintlify.site/concepts/idempotency.md).
3. **v1 asynchronous results.** A v1 call that answers HTTP 202 with `status: "pending"` and `IDTO_203` is not charged at that point. The verification finishes in the background and is charged once, by the rule above, when it completes. Fetching the result from `/verify/result/{reference_id}` never charges.

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

On v2, `billed` is the single source of truth, and it means the same thing on every product regardless of which underlying provider served the request. Every v2 body also carries `chargeble` and `user_consent` as the strings `"true"` or `"false"`. These are legacy flags kept for older integrations and simply mirror `billed`; despite its name, `user_consent` in a response does not report whether consent was given. Branch on `billed`.

On v1 there is no `billed` field. A charged v1 call carries `chargeble: "true"` and `user_consent: "true"`; an uncharged one carries neither. Whether a no-record answer counts as `"success"` on v1 depends on the product, so read those two flags rather than assuming.

### Billing per outcome

| Outcome | HTTP | `status` | `error_code` | `billed` |
| - | - | - | - | - |
| Full match | 200 | `success` | `null` | `true` |
| Definitive no record | 200 | `success` | `IDTO_202` | `true` |
| Same call, replayed with its `Idempotency-Key` | 200 | as first response | as first response | as first response, no new charge |
| Step already paid for by a verification session | 200 | `success` | `null` or `IDTO_202` | `false` |
| Bad input, missing consent | 400 or 422 | `error` | `IDTO_001`, `IDTO_005` | `false` |
| Source busy or failing | 429 or 503 | `error` | `IDTO_006`, `IDTO_008`, `IDTO_103`, `IDTO_403` | `false` |
| Unreadable Aadhaar QR | 422 | `error` | `IDTO_204` | `false` |
| Any other raised error | 4xx or 5xx | `error` | any `IDTO_*` code, or `null` | `false` |

A replayed response is a copy of the stored first response, so its `billed` value describes that first charge. It is not a second one.

### When the charge is taken

Without an `Idempotency-Key`, the call record and the charge are committed together: if the deduction fails, the whole call fails and nothing is recorded as billed. With a key, idto stores the result first, so that a retry can be replayed, and then takes the charge once for that call. Either way a verification is charged at most once.

### Balance

Before a standalone verification runs, idto checks that your balance covers it. If it does not, the call is rejected with HTTP 400 and the message `Insufficient credits for this operation.`, nothing is sent to a verification source and nothing is billed. Recharge from **Billing** in the dashboard and resend. A replay of a stored result skips this check, so a retry of a call that already completed still gets its answer when the balance is low. Calls whose step is paid for by a verification session skip the per-call balance check.

To audit charges, open **Transactions** in the dashboard. Each verification shows whether it was charged, and a call that was retried automatically shows its attempts with the one that was charged.

For the full per-code billing table, see [Error Codes](https://idto.mintlify.site/reference/v2-error-codes.md). For the exact body each kind of response carries, see [Error response shapes](https://idto.mintlify.site/concepts/request-response.md#error-response-shapes).

## Consent

Consent is enforced per product, not globally. Four v2 endpoints currently require a `user_consent` boolean field in the request body: `pan_validation`, `pan_detailed`, `okyc_generate_otp`, and `aadhaar_qr`.

```json theme={null}
{
  "pan_number": "ABCDE1234F",
  "user_consent": true
}
```

If `user_consent` is missing or not truthy, the request is rejected before any verification runs:

```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
}
```

This is a raised error (HTTP 400), so it is never billed: you can correct the request and resend without losing a credit. On `pan_validation`, `pan_detailed` and `okyc_generate_otp`, only `true`, `"true"` and `"True"` are accepted; anything else, including `false`, `"yes"`, `1`, an empty string, or a missing field, triggers `IDTO_005`. `aadhaar_qr` reads the field more loosely (in a multipart form, `true`, `1` and `yes` in any letter case all count). Send the JSON boolean `true`, or the string `true` in a form, on every product so the same value works everywhere.

Input checks run before the consent check. On the PAN products, a missing or malformed `pan_number` returns `IDTO_001` (400) even when consent is also missing, so fix input errors first and expect `IDTO_005` only once the rest of the request is valid.

### Capturing consent

`user_consent: true` is your statement that the person agreed to this verification. idto checks that the field is present and truthy; it cannot check how you obtained the agreement. Before you send it:

1. Show the person what will be verified and why, before they enter their details.
2. Record their agreement on your side with a timestamp and the text they saw.
3. Send `user_consent: true` only for a request made after that agreement, and never hardcode it for every call.

When you use an idto verification session (SDK or verification link), the consents the user gives in the flow are recorded against the session. The session completion webhook and the session state endpoint carry a summary of them: `consent_type`, `consent_version` and `consented_at`, never the consent text.

The other v2 products do not currently declare a `user_consent` field. Consent enforcement is added product by product as each one is built, so check the specific endpoint's request schema (under the API Reference tab) rather than assuming every v2 product requires it. If you don't see `user_consent` listed as a required field for the endpoint you're calling, it isn't enforced there today.

## Production checklist

* Your code reads `billed` for cost tracking and `error_code` for the verification outcome, never `chargeble` or `user_consent`.
* `IDTO_202` is handled as a definitive, billed answer, not retried as a failure.
* Retries send the same `Idempotency-Key`, so a timeout never turns into two charges.
* A low-balance alert is set so `Insufficient credits for this operation.` never reaches production traffic.
* Consent is captured and stored before any request that sends `user_consent: true`.

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


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