Settle an x402 payment with organization-specific authentication
Settle a Nanopayments Gateway (Circle Gateway batched) payment. This is the sameDocumentation Index
Fetch the complete documentation index at: https://docs.mrdn.finance/llms.txt
Use this file to discover all available pages before exploring further.
POST /v1/settle endpoint used by the default x402 path. The facilitator inspects paymentRequirements.extra and forwards batched requests to Circle’s Gateway API instead of settling on-chain.
paymentRequirements.extra.name === "GatewayWalletBatched"paymentRequirements.extra.version === "1"GATEWAY_MAINNET_ENABLED flag, currently true)extra indicates batched but the network is not Gateway-enabled, the facilitator returns HTTP 403 with errorReason: "gateway_not_enabled".
Authorization: Bearer <api-key>. Recipient is taken from your organization settings or from paymentRequirements.extra.creditedRecipient.
| Field | Notes |
|---|---|
paymentRequirements.asset | Set to the Gateway Wallet contract for this network (used as verifyingContract in EIP-712 signing). The facilitator swaps it back to USDC before forwarding to Circle. |
paymentRequirements.maxTimeoutSeconds | 345600 (4 days) is the recommended Circle Gateway nanopayment validity window. |
payload.authorization.value | USDC base units (6 decimals). 10000 = 0.01 USDC. |
extra.name + extra.version | Required exactly as "GatewayWalletBatched" and "1". This is the routing trigger. |
{ ...gatewayResponse, settlementMethod, network, testnet, authContext } after toJsonSafe():
success and transaction (and any other fields) are forwarded from Circle.settlementMethod: "batched" confirms the Circle Gateway path was taken.testnet is true when network is one of base-sepolia, optimism-sepolia, or fluent-testnet.authContext.authMethod is the literal string "middleware_handled".authContext does not include organizationId (unlike verify).success: false, the facilitator forwards it with HTTP 400. The shape is { ...gatewayResponse, settlementMethod, network, testnet } (no authContext):
gateway_not_enabled: paymentRequirements.extra matched batched but isGatewayEnabledForNetwork(network) returned false.batched_settle_error: forwarding to Circle threw before a response could be parsed (network error, SDK exception, etc.).errorReason Circle returns: passed through verbatim alongside settlementMethod: "batched".