Payments
USDC transfers, payment routing, and gas-sponsored transactions on Algorand.
Simple Payment
from algopay import AlgoPay
ap = AlgoPay()
result = ap.pay(
wallet_id="wallet_123",
to="RECIPIENT_ALGO_ADDRESS",
amount=5.00, # USDC
purpose="API usage fee",
)
print(result.tx_id) # Algorand transaction ID
print(result.status) # "settled"Payment Lifecycle
| Status | Meaning |
|---|---|
| pending | Payment created, awaiting processing |
| processing | Transaction submitted to Algorand |
| settled | Confirmed on-chain |
| failed | Transaction failed or rejected by policy |
Gas Sponsorship
AlgoPay supports gas-sponsored transactions via gas pools. Agents can send USDC without holding ALGO for transaction fees — the gas pool covers the fee.
How gas pools work
- 1. Create a gas pool and fund it with ALGO
- 2. Assign agents to the pool
- 3. Agent USDC transfers use pool ALGO for fees
- 4. Daily caps prevent excessive gas usage
Payment Intents
Payment intents let you create, preview, and confirm payments in separate steps. Useful for approval flows or when the agent needs to show the user what will happen.
intent = ap.intents.create(
wallet_id="wallet_123",
to="RECIPIENT",
amount=10.00,
)
print(intent.estimated_fee)
# Later, after approval:
result = ap.intents.confirm(intent.id)