Interface: PaymentRejectionInfo<TRequirements, TPayload>
Defined in: packages/x402-express/src/options.ts:187
What PaymentRequiredOptions.onReject receives.
Type Parameters
TRequirements
TRequirements extends X402PaymentRequirements<unknown> = CantonPaymentRequirements
TPayload
TPayload extends X402PaymentPayload<unknown> = CantonPaymentPayload
Properties
details?
details?: string;Defined in: packages/x402-express/src/options.ts:196
The details string in the response body, when there is one.
error?
error?: unknown;Defined in: packages/x402-express/src/options.ts:205
The underlying error, for a 502 or 500.
extensions?
extensions?: Record<string, unknown>;Defined in: packages/x402-express/src/options.ts:203
For a verify rejection, the facilitator's full extensions — detail says which of the code's causes it was, and a facilitator may add more. The middleware's own refusal of a transfer it cannot decode sets one in the same shape.
payment?
payment?: object;Defined in: packages/x402-express/src/options.ts:227
The payment this refusal is about — present exactly when an undo may be owed, which is once PaymentRequiredOptions.preSettle has ACCEPTED it. So: a settle that failed or threw, and anything that goes wrong after. Absent for every refusal before that point, preSettle's own included.
It is what lets a merchant undo work preSettle did — releasing stock it reserved, reopening an order it marked claimed. requirements.extra carries whatever reference the merchant quoted, and it is one the payer signed: verify has held these requirements against the transfer.
Not attached earlier on purpose. Before verify the requirements are whatever the header claimed, so an underpriced payment echoing another order's reference would name that order here and a merchant releasing it would release someone else's.
One thing it cannot tell you: a 502 from a settle that threw may still have gone through on the ledger, the answer having been lost rather than the payment. Undoing on that one is a decision about which way to be wrong, not a certainty.
payer
payer: string;The verified transfer's sender, as preSettle received it.
payload
payload: TPayload;requirements
requirements: TRequirements;The accepts[] entry the payer chose, as preSettle received it.
reason
reason: string;Defined in: packages/x402-express/src/options.ts:194
The error code in the response body (e.g. invalid_exact_canton_signature_invalid, facilitator_error).
status
status: 402 | 500 | 502;Defined in: packages/x402-express/src/options.ts:192
HTTP status sent: 402 (payment rejected), 502 (facilitator error), 500 (middleware error).