Interface: X402PaymentRequiredResponse<TRequirements>
Defined in: packages/x402-core/src/types/requirements.ts:179
The x402 v2 PaymentRequired object a 402 Payment Required answers with: one resource, and the ways to pay for it. The client picks one of accepts[], pays it, and retries the request with the PAYMENT-SIGNATURE header.
The HTTP transport carries it base64-encoded in the PAYMENT-REQUIRED response header (encodePaymentRequiredHeader). The merchant middleware sends it as the body too, with a details string beside it.
Generic over the accepts[] element (TRequirements) so a mixed-scheme offer (e.g. canton-exact + a bridge scheme) is expressible as a union; every other field is shared. Generic → type-only.
Type Parameters
TRequirements
TRequirements = CantonPaymentRequirements
Properties
accepts
accepts: TRequirements[];Defined in: packages/x402-core/src/types/requirements.ts:184
Payment options; the client satisfies exactly one of them.
error?
error?: string;Defined in: packages/x402-core/src/types/requirements.ts:186
Optional machine-readable reason, e.g. "payment_required".
extensions?
extensions?:
| {
[key: string]: unknown;
}
| null;Defined in: packages/x402-core/src/types/requirements.ts:187
resource
resource: object & object;Defined in: packages/x402-core/src/types/requirements.ts:182
What is being paid for. Required by the spec.
Type Declaration
description?
description?: string | null;iconUrl?
iconUrl?: string | null;mimeType?
mimeType?: string | null;serviceName?
serviceName?: string | null;tags?
tags?: string[] | null;url
url: string;x402Version
x402Version: 2;Defined in: packages/x402-core/src/types/requirements.ts:180