Making Payments

This guide walks you through making your first autonomous payment and understanding the payment process.

Quick Start

1. Connect Your Wallet

First, connect a Web3 wallet:

  • Click "Connect Wallet" button

  • Choose MetaMask, Coinbase Wallet, or another provider

  • Approve the connection

2. Make a Request

Tell Alfred402 what you need:

"Get me weather data for San Francisco"

3. Review Payment

Alfred402 will show you:

Found: WeatherAPI Premium
Cost: 0.001 ETH (~$2.50)
✓ Within spending limits

4. Automatic Processing

Payment happens automatically:

  • Transaction submitted

  • Confirmed in ~2 seconds

  • Service accessed

  • Data delivered

Detailed Payment Flow

Step 1: Service Discovery

When you make a request, Alfred402:

  1. Parses your intent: Understands what service you need

  2. Queries x402 Registry: Finds compatible services

  3. Checks availability: Ensures service is online

  4. Retrieves pricing: Gets current cost

Step 2: Pre-Flight Checks

Before processing payment:

Step 3: Transaction Construction

Alfred402 builds the transaction:

Step 4: Signing & Submission

Your wallet automatically:

  • Signs the transaction

  • Submits to blockchain

  • Returns transaction hash

Step 5: Confirmation

Wait for blockchain confirmation:

Step 6: Service Access

With payment confirmed:

  1. Alfred402 retries service request

  2. Includes payment proof in headers

  3. Service validates payment

  4. Returns requested data

Payment Methods

Native Tokens

Pay with blockchain's native currency:

Ethereum

Solana

ERC20 Tokens

Pay with stablecoins or other tokens:

USDC

Automatic Chain Selection

Alfred402 automatically uses the correct chain:

  • Service specifies accepted chains

  • Alfred402 selects cheapest/fastest

  • Prompts wallet to switch if needed

Understanding Costs

Service Fee

What the service charges:

Gas Fee

Blockchain transaction cost:

Total Cost

Payment Examples

Example 1: Simple Data Request

Example 2: AI Image Generation

Example 3: File Storage

Payment Status

Pending

What's happening: Transaction in mempool, waiting for miners

Confirming

What's happening: Included in block, waiting for more confirmations

Completed

What's happening: Payment confirmed, service accessed

Failed

What's happening: Transaction reverted, funds returned

Handling Issues

Insufficient Balance

Gas Price Spike

Service Unavailable

Limit Exceeded

Best Practices

Before Making Payments

  1. Verify Service: Check if service is verified in registry

  2. Check Price: Ensure cost is reasonable

  3. Review Limits: Confirm within your spending limits

  4. Check Balance: Ensure sufficient funds + gas buffer

During Payment

  1. Don't Close: Keep browser open during transaction

  2. Wait for Confirmation: Don't retry immediately

  3. Check Status: Monitor transaction hash on explorer

After Payment

  1. Verify Receipt: Check transaction on block explorer

  2. Save Hash: Keep transaction hash for records

  3. Review Service: Was the service satisfactory?

  4. Update Limits: Adjust if needed based on usage

Security Tips

Protect Your Wallet

  • Never share private keys

  • Use hardware wallet for large amounts

  • Keep seed phrase offline

  • Enable 2FA where possible

Verify Services

Before first use:

  • Check service verification status

  • Read reviews from other users

  • Test with small payment first

  • Verify service URL/address

Monitor Spending

  • Review transaction history daily

  • Set conservative limits initially

  • Enable spending alerts

  • Use separate wallet for testing

Recognize Scams

Red flags:

  • Unverified services

  • Unusually low prices

  • Requests for private keys

  • Off-chain payment requests

Advanced Features

Batch Payments

Coming soon:

Scheduled Payments

Coming soon:

Multi-Chain Routing

Coming soon:

  • Auto-select cheapest chain

  • Bridge tokens when needed

  • Optimize for speed vs cost

Transaction History

View all payments:

Troubleshooting

Payment Stuck

Solution:

  1. Check block explorer

  2. Verify transaction is pending

  3. Wait 5-10 minutes

  4. Contact support if persists

Wrong Amount Charged

Solution:

  1. Check transaction on explorer

  2. Verify service pricing

  3. Account for gas fees

  4. Contact service provider

Service Didn't Deliver

Solution:

  1. Save transaction hash

  2. Contact service support

  3. Request refund if eligible

  4. Report to Alfred402 support

Learn More


Need help? Email [email protected]

Last updated