API Reference
Base URL: https://facilitator.pop402.com
Authentication Endpoints
POST /challenge
Generate authentication challenge.
Request:
walletAddress(string, required) - Base58 Solana addressttl(number, optional) - Seconds until expiration (default: 300)
Response:
challenge.id- Unique challenge identifierchallenge.message- Message to signchallenge.expiresAt- Unix timestampchallenge.expiresIn- Seconds until expiration
POST /verify
Verify payment or challenge.
Request:
paymentPayload.x402Meta(object) - Payment metadatachallengeId(string) - For challenge authsignature(string) - Base58 signaturewalletAddress(string) - Base58 addresssku(string) - Product identifier
paymentRequirements(object)network(string) - "solana" or "solana-devnet"
Response:
isValid(boolean) - Access grantedpayer(string) - Wallet addressinvalidReason(string, optional) - Error code
POST /settle
Process payment and generate receipt.
Request:
- Same structure as /verify
- Additional metadata for receipt generation
Response:
success(boolean)receiptId(string) - Receipt identifiertransaction(string) - Transaction signaturenetwork(string)
Metadata Fields
x402Meta Object
Challenge Auth:
challengeId- Challenge identifiersignature- Wallet signaturewalletAddress- Payer addresssku- Product SKU
License Info:
usageType- "single_use" | "unlimited"expirationDate- Unix timestamp (optional)
Branding:
buyerEmail- Buyer email for receiptsellerEmail- Seller notification emaillogoUrl- Logo URL for receiptprimaryColor- Brand color hexsecondaryColor- Accent color hex
Error Codes
Challenge Errors
challenge_not_found- Challenge doesn't existchallenge_expired- TTL passedwallet_mismatch- Wrong walletinvalid_signature- Bad signature
License Errors
no_license- No valid licenselicense_expired- License past expirationusage_exhausted- Single-use license already used
Payment Errors
invalid_transaction- Transaction validation failedtransaction_failed- Blockchain errorinsufficient_payment- Amount too low
Rate Limits
- 100 requests per minute per IP
- 1000 requests per hour per wallet
Networks
Supported networks:
solana- Mainnetsolana-devnet- Devnet for testing