Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.x402r.org/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The auth-capture scheme for x402 v2 uses the audited Commerce Payments Protocol (AuthCaptureEscrow + token collectors) directly, no fork. The client signs a single signature (ERC-3009 or Permit2). The facilitator submits it, either locking funds in escrow for later capture (two-phase) or sending them directly to the receiver with refund capability (single-shot). Unlike exact, which has no mechanism for returning funds, auth-capture supports returning funds to the client through void, refund, and reclaim.

Settlement Paths

The scheme supports two settlement paths, selected via extra.autoCapture:
autoCaptureBehavior
false (default)Two-phase. Funds held in escrow. CaptureAuthorizer can capture, void, or refund. Client can reclaim if the capture deadline passes.
trueSingle-shot. Funds sent directly to the receiver. CaptureAuthorizer can refund post-settlement.

Two-phase (autoCapture: false, default)

AUTHORIZE -> RESOURCE DELIVERED -> CAPTURE / VOID -> (REFUND)
1

Authorize

The facilitator submits the client’s authorization, locking funds in escrow via AuthCaptureEscrow.authorize(). The token collector executes the client’s signature (ERC-3009 receiveWithAuthorization or Permit2 permitTransferFrom) to pull tokens into escrow.
2

Resource Delivered

Server returns the resource (HTTP 200).
3

Capture or Void

The captureAuthorizer can capture (capture funds to the receiver) or void (return escrowed funds to the client). Capture conditions are policy-defined per captureAuthorizer (time-locked, arbiter-approved, etc.).
4

Reclaim

If captureDeadline passes without capture, the client can reclaim funds directly from the escrow without captureAuthorizer involvement.
5

Refund (Optional)

After capture, the captureAuthorizer can refund within the refundDeadline window.

Single-shot (autoCapture: true)

CHARGE -> RESOURCE DELIVERED -> (REFUND)
1

Charge

The facilitator submits the client’s authorization, sending funds directly to the receiver via AuthCaptureEscrow.charge(). No escrow hold.
2

Resource Delivered

Server returns the resource (HTTP 200).
3

Refund (Optional)

The captureAuthorizer can refund within the refundDeadline window.
No capture, void, or reclaim, funds are never held in escrow.

Visual Flow

Exact Payment (Immediate Settlement)

auth-capture (Two-phase)

Key Differences

AspectExactauth-capture
SettlementImmediate on requestVia escrow (two-phase) or direct with refund (single-shot)
Payer ProtectionNone (payment final)Refundable in both paths
Resource DeliveryAfter payment clearsImmediately after authorization
RecourseNo recourseReclaim after capture deadline, refund via captureAuthorizer
Fee SystemNoneConfigurable (min/max bounds, client-signed)
Use CaseTrusted, low-value, instantHigh-value, variable cost, disputes

CaptureAuthorizer

The captureAuthorizer is the address that may call authorize, capture, void, refund, or charge on a payment. The escrow contract gates those operations on msg.sender. In x402’s facilitator-submits flow that means either the facilitator’s EOA, or any smart contract that ends up calling the escrow (for example, an arbiter contract with dispute logic or a multisig).
Use CaseCaptureAuthorizer
Session billingEOA that tracks usage off-chain, captures periodically
Time-locked escrowContract that releases after a period expires
Dispute resolutionArbiter contract that decides capture vs refund
Immediate (exact-like)Facilitator with autoCapture: true for instant settlement
Streaming paymentsContract that performs time-proportional captures

vs Exact Scheme

The auth-capture scheme adds an authorization step before settlement (or refundability for single-shot). For simple immediate payments where trust and refundability aren’t concerns, the exact scheme remains more efficient.

Next Steps

Wire Format

PaymentRequirements and PaymentPayload shapes for EIP-3009 and Permit2.

Verification and Settlement

The 13-step verification flow, settlement logic, and error codes.

PaymentInfo Struct

On-chain struct, expiry ordering, and safety guarantees.

SDK Overview

Build your first auth-capture payment flow.

References