Skip to main content
Use this page when an ELUUP x402 request does not return the expected successful response. It covers request validation, token resolution, backend failures, payment failures, status codes, and nullable response fields.

Request Validation

Before any payment is requested, every batch endpoint validates the request body in this order. A request failing any step below is rejected with 400 and no payment is charged.

Schema validation

The request body must match the endpoint’s schema (correct field names, types, required fields). Validation errors are returned as:
The error string is built as "<field path>: <message>", joined with ; if multiple fields fail. Common cases:

Batch size limit

Duplicate token rejection

If the same token identifier (case-insensitive) appears more than once in tokens, the entire request is rejected — you are not charged for the duplicate:

Token resolution

After passing the checks above, every identifier in the batch is resolved against on-chain/market data. Resolution fails closed on the whole batch — if even one identifier can’t be resolved, the entire request is rejected with 404 and, again, no payment is charged:
This means a batch is always all-or-nothing: either every token resolves and you pay for exactly that many, or nothing resolves and nothing is charged. Payment is only requested once every token in the batch has been confirmed to resolve.

Error Handling Overview

Errors fall into four categories:
  1. Request validation errors400 (Request Validation)
  2. Duplicate-token errors400 (Duplicate token rejection)
  3. Token resolution errors404 (Token resolution)
  4. x402 payment errors402, generated by the payment middleware, not the application wrapper (HTTP 402 — Payment Required)
Plus endpoint-specific backend failures (502 on /v1/token-prices, 404 on /v1/top-performers and /v1/aggregate-metrics if their underlying logic fails).

HTTP 400 — Validation Error

The error string is derived from schema validation and will reference the offending field path (e.g. tokens, tokens.0.identifier).

HTTP 400 — Batch Limit Error

Requests with more than 5 tokens are rejected before any payment is requested:

HTTP 400 — Duplicate Token Error

Requests containing the same token identifier more than once (case-insensitive) are rejected before any payment is requested:

HTTP 404 — Token Resolution Error

If any identifier in the batch can’t be resolved, the entire batch is rejected — no payment is requested:
/v1/top-performers and /v1/aggregate-metrics also return 404 (with the same wrapper) if their underlying logic returns an unsuccessful result — in that case payment has already been made, since these are non-batch endpoints without a pre-payment resolution step.

HTTP 502 — Backend Error

/v1/token-prices returns 502 if its underlying price logic fails, using the standard response wrapper.

Status Code Summary


Nullable Fields

Consumers must not assume these fields are always numeric.
x402 docs: Overview · Quickstart · Payment Flow · API Reference · Errors & Troubleshooting · Examples