Basic Payment Flow
Policy Enforcement
Every payment automatically goes through policy checks:Error Handling
Handle different payment failure scenarios:Common Error Codes
| Status | Reason | What to Do |
|---|---|---|
rejected | per_transaction_limit | Reduce amount or update policy |
rejected | daily_limit | Wait for daily limit to reset |
rejected | merchant_blocked | Remove from blocklist or change merchant |
rejected | insufficient_balance | Fund the wallet |
failed | network_error | Retry with exponential backoff |
failed | invalid_address | Verify recipient address |
pending_approval | approval_threshold | Wait for human approval |
Idempotency
Sardis automatically handles idempotency to prevent duplicate payments:- Must be unique per payment intent
- Valid for 24 hours
- Automatically generated if not provided
- Recommended for all production payments
Async Payments
For high-throughput applications, use async payments:Cross-Chain Payments
Sardis automatically routes payments to the optimal chain:Chain Selection Logic
- If
preferred_chainspecified, use it - If recipient is a smart contract, detect chain from address
- If recipient is a merchant, use merchant’s preferred chain
- Otherwise, use wallet’s default chain (lowest fees)
Batch Payments
Execute multiple payments in one transaction:- Execute atomically (all or nothing)
- Save on gas costs (single transaction)
- Still enforce policy per-payment
- Return individual results for each payment
Transaction Receipts
Get detailed transaction receipts:Payment Monitoring
Monitor payment status in real-time:Advanced: Payment Metadata
Attach metadata to payments for tracking:- Stored on-chain and in Sardis ledger
- Searchable via API
- Included in webhooks
- Max 1KB per transaction
Troubleshooting
Payment fails with 'insufficient balance'
Payment fails with 'insufficient balance'
Check on-chain balance vs. spending limits:If on-chain balance is sufficient but payment fails, check if you’ve exceeded daily/total spending limits.
Transaction stuck in 'pending' status
Transaction stuck in 'pending' status
Blockchain confirmations can take 10-60 seconds depending on the chain:Low gas price can cause delays. Contact support if stuck >15 minutes.
- Base: ~2 seconds
- Polygon: ~3 seconds
- Ethereum: ~12-15 seconds
- Arbitrum: ~1 second
- Optimism: ~2 seconds
How to cancel a pending payment
How to cancel a pending payment
Payments cannot be cancelled once submitted to the blockchain. However, you can:
- Before submission: Don’t call
execute()orpay() - After submission: Wait for confirmation or failure
Payment succeeded but recipient didn't receive funds
Payment succeeded but recipient didn't receive funds
Check transaction details:Common issues:
- Wrong chain (sent USDC on Base but recipient expects Ethereum)
- Wrong token (sent USDT instead of USDC)
- Wrong address (typo or wrong recipient)
Rate limits and throughput
Rate limits and throughput
Sardis API rate limits:
- Free tier: 10 requests/second
- Pro tier: 100 requests/second
- Enterprise: Custom limits
Next Steps
Webhooks
Get notified of payment events
Agent-to-Agent
Enable agents to pay each other
Virtual Cards
Pay merchants that don’t accept crypto
Testing
Test payments in sandbox mode