Skip to main content
POST
Settle Payment

Endpoint

Initiate settlement of a verified payment. The facilitator will:
  1. Collect $0.01 fee from merchant’s approved USDC balance
  2. Execute customer → merchant payment via 1Shot API
Fee Collection: The $0.01 fee is collected from the merchant’s pre-approved USDC balance BEFORE settlement execution.

Request Parameters

object
required
Same payment payload used in verification
object
required
Same payment requirements used in verification

Request Examples


Response Examples


Response Fields

boolean
required
Whether settlement completed successfully
null
required
Always null (maintained for x402 compatibility)
string
required
Human-readable settlement result
object
details.settlement_id: Unique settlement identifierdetails.verification_id: Associated verification IDdetails.settled_amount: Amount settled (customer payment)details.merchant_received: Amount merchant received (same as settled_amount)details.fee_amount_wei: Fee collected from merchant (10000 = $0.01)details.fee_collection_status: “collected” | “failed”details.fee_tx_hash: On-chain transaction hash of fee collectiondetails.settlement_tx_hash: On-chain transaction hash of settlementdetails.fee_collected_first: Always true (guarantees no free service)details.pricing_model: “flat_rate”details.description: Explanation of fee collection method

Settlement Process


Settlement States


Fee Collection Details

Pre-Settlement Fee Collection

Why collect fee first? Prevents free service exploitation. If settlement executed before fee collection, merchants could intentionally cause settlement failures to get free verification service. Process:
If fee collection fails:
  • Settlement is blocked
  • Customer is NOT charged
  • Merchant receives error: insufficient_allowance or fee_collection_failed
If settlement fails after fee:
  • Merchant paid $0.01 for the attempt
  • This is intentional (prevents exploitation)

Handling Settlement Status

Polling for Completion


Common Issues

Error: fee_collection_status: insufficient_allowanceSolution: Merchant must approve facilitator:
Error: fee_collection_failed: Insufficient USDC balanceSolution: Merchant needs to add USDC to their addressCheck balance:
Error: settlement_failed: authorization is expiredSolution: Customer needs to create new authorization with longer validity:
Error: settlement_failed: authorization is used or canceledSolution: Generate new unique nonce for each payment:
Normal: 35-70 secondsBreakdown:
  • Fee collection: 5-10 seconds
  • Provider submission: 5-15 seconds
  • On-chain confirmation: 15-45 seconds
If longer: Check Base network status and Provider API status

On-Chain Verification

All transactions are publicly verifiable:

Settlement Timing

Settlement typically completes in 35-70 seconds on Base. Use polling or webhooks to track status.

Merchant Economics

Per settlement:
Example: 1000 settlements

Best Practices

1

Ensure Sufficient Approval

Before going live, verify merchant has approved enough USDC:
2

Maintain USDC Balance

Ensure merchant address has USDC for fees:
  • Minimum: 1 USDC (100 settlements)
  • Recommended: Match approval amount
3

Handle Errors Gracefully

Catch and display user-friendly error messages:
4

Monitor Settlements

Log settlement IDs and track success rates:

Next Steps

Verify Payment

Verify before settling

Error Handling

Handle settlement failures

Webhooks

Get settlement notifications

Architecture

Understand fee collection
Settlement complete! Customer payment delivered to merchant, fee collected from merchant’s approved balance.