Expand description
Payment envelopes for the x402 protocol.
JSON is camelCase with deny_unknown_fields. Identifier strings use
compact_str::CompactString.
Structs§
- Base64
Bytes - Raw bytes holding the base64 ASCII of some payload.
- Extensions
- Canonical x402 extension envelope: extension id →
ExtensionEntry. - Payment
Payload - Signed payment authorization sent by the buyer.
- Payment
Required - Body of an HTTP 402 Payment Required response.
- Payment
Requirements - Payment terms set by the seller.
- Price
Tag - Seller-side wrapper around
PaymentRequirements. - Resource
Info - Human-readable metadata describing the paid resource.
- Settle
Request - Wire-level settle request. Same JSON as
VerifyRequest, distinct type. - Settlement
Overrides - Official wire shape for partial settlement.
- Supported
Payment Kind - A single payment kind advertised by a facilitator.
- Supported
Response - Response body of a facilitator’s
/supportedendpoint. - Typed
Verify Request - Protocol-versioned verify request parameterized by payload and requirements.
- U64String
- A
u64that serializes as a JSON string. - Unix
Timestamp - Unix timestamp in seconds since 1970-01-01T00:00:00Z.
- Verify
Request - Wire-level verify request, stored as opaque JSON.
- Version
- Compile-time protocol-version marker that serializes as a bare integer.
Enums§
- Extension
Entry - Payload attached to a single extension key.
- Settle
Response - Settlement outcome returned by a facilitator.
- Settlement
Override Error - Failure resolving a settlement override amount string.
- Verify
Response - Verification outcome returned by a facilitator.
Constants§
- DEFAULT_
ASSET_ DECIMALS - Default ERC-20 style decimals when
extra.decimalsis absent. - EXTENSION_
RESPONSE_ LOG_ FIELDS - Field names from an
EXTENSION-RESPONSESvalue that may be logged. - V2
- Singleton value for
Version2.
Functions§
- asset_
decimals_ from_ extra - Reads
decimalsfrom payment-requirementsextra(number or numeric string). - find_
matching_ requirements - First entry in
availablethat matchesaccepted. - resolve_
settlement_ override_ amount - Resolves a settlement override amount to atomic units (decimal string).
- schema_
has_ external_ ref truewhen any$refor$idis not a same-document#fragment.
Type Aliases§
- Version2
- x402 v2 version marker.