extension

An extension is an optional piece of x402 functionality outside the core payment mechanics. A server advertises the extensions it supports in the payment challenge, and a client echoes them back when it pays. The core stays small, and what a particular deployment needs beyond it arrives as a named extension rather than as a new version of the protocol.

The specification states the mechanism plainly: extensions enable modular optional functionality beyond core payment mechanics, servers advertise supported extensions in PaymentRequired, and clients echo them in PaymentPayload. A client must include at least the information it received; it may append to that information but cannot delete or overwrite what the server sent.

Where the object sits is worth knowing before parsing a challenge. extensions is an optional field of PaymentRequired itself, beside the accepts array rather than inside one of its entries, and each key names an extension whose value carries the server's info and the JSON Schema that info conforms to. An extension therefore describes the response, not a single payment option in it.

The published extensions do different jobs. They cover the discovery catalogue format, a signed offer and payment receipt pair, gasless approval flows in which a facilitator pays the network fee, and HTTP message signatures for establishing the identity of the paying agent.

This is also how the rail changes without changing version. An endpoint that begins advertising an extension is answering differently from the day before, and the difference is in the challenge itself rather than in a release note somewhere.

→ probe402 archives each tracked endpoint's challenge, extensions included — open an endpoint from the endpoint list.

Sources

Related accepts array · payment challenge · transport · x402

Glossary