Executes on-chain settlement by callingDocumentation Index
Fetch the complete documentation index at: https://docs.b402.ai/llms.txt
Use this file to discover all available pages before exploring further.
transferWithAuthorization() on the b402 Relayer contract. The facilitator re-verifies the payload, submits the transaction, and pays gas on behalf of the payer.
Settlement typically completes in ~3 seconds on supported chains. The facilitator covers all gas costs.
Request Body
The request body is identical to/verify.
| Field | Type | Description |
|---|---|---|
paymentPayload | object | Signed payment data |
paymentPayload.token | string | Token contract address |
paymentPayload.payload | object | Authorization and signature |
paymentPayload.payload.authorization | object | EIP-712 authorization fields |
paymentPayload.payload.authorization.from | string | Payer wallet address |
paymentPayload.payload.authorization.to | string | Recipient wallet address |
paymentPayload.payload.authorization.value | string | Amount in wei (uint256) |
paymentPayload.payload.authorization.validAfter | number | Unix timestamp, signature valid after |
paymentPayload.payload.authorization.validBefore | number | Unix timestamp, signature valid before |
paymentPayload.payload.authorization.nonce | string | Random bytes32 nonce |
paymentPayload.payload.signature | string | EIP-712 signature |
paymentRequirements | object | Network and contract details |
paymentRequirements.network | string | Target network ("bsc" or "base") |
paymentRequirements.relayerContract | string | b402 Relayer contract address |
Response
Successful Settlement (200)
| Field | Type | Description |
|---|---|---|
success | boolean | true |
transaction | string | On-chain transaction hash |
network | string | Network where the transaction was settled |
payer | string | Payer wallet address |
blockNumber | number | Block number containing the transaction |
Failed Settlement (200)
| Field | Type | Description |
|---|---|---|
success | boolean | false |
network | string | Target network |
errorReason | string | Why settlement failed |
What Happens On-Chain
- The facilitator re-runs all verification checks
- The facilitator calls
transferWithAuthorization()on the Relayer contract with the signed authorization - The Relayer contract verifies the EIP-712 signature, checks the nonce, and executes
transferFrom()on the token contract - The nonce is marked as used on-chain, preventing replay
- An
AuthorizationUsedevent is emitted for on-chain auditability
Examples
cURL
TypeScript
Verify then Settle (Full Flow)
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
payment_settlement_error | 500 | Transaction submitted but reverted on-chain |
blockchain_error | 500 | RPC or network-level failure (timeout, node unavailable) |
signature_error | 400 | EIP-712 signature is malformed or recovery failed during re-verification |
If you receive a
blockchain_error, wait a few seconds and retry. Transient RPC issues typically resolve quickly.Related
- Verify Payment (EOA) - Verify before settling
- Facilitator Overview - How verification and settlement fit together
- Quickstart - Get started with b402
