Base Subscriptions enable recurring USDC payments. Users grant your application permission to charge their account periodically, eliminating the need for manual approvals on each payment. No fees for merchants or users.
How Subscriptions Work
1
User Creates Subscription
User approves a spend permission for your application to charge a specific amount periodically.
2
Application Charges Periodically
Your backend charges the subscription when payment is due, up to the permitted amount per period.
3
Automatic Period Reset
The spending limit resets automatically at the start of each new period.
4
User Can Cancel Anytime
Users maintain full control and can revoke the permission at any time.
Core Functions
subscribe
Create a new subscription with spend permissions
getSubscriptionStatus
Check subscription status and remaining charges
prepareCharge
Prepare transaction calls to charge a subscription
Complete Implementation Example
Client-Side: Create Subscriptions
Users create subscriptions from your frontend application:SubscriptionButton.tsx
Server-Side: Charge Subscriptions
Never expose your subscription owner private key
chargeSubscriptions.ts
Testing on Testnet
Test your subscription implementation on Base Sepolia before going live:Network Support
Network | Chain ID | Status |
---|---|---|
Base Mainnet | 8453 | ✅ Production Ready |
Base Sepolia | 84532 | ✅ Testing Available |