Why Base Pay?
USDC on Base is a fully-backed digital dollar that settles in seconds and costs pennies in gas. Base Pay lets you accept those dollars with a single click—no cards, no FX fees, no chargebacks.- Any user can pay – works with every Base Account (smart-wallet) out of the box.
- USDC, not gas – you charge in dollars; gas sponsorship is handled automatically.
- Fast – most payments confirm in <2 seconds on Base.
- Funded accounts – users pay with USDC from their Base Account or Coinbase Account.
- No extra fees – you receive the full amount.
Client-side (Browser SDK)
Interactive Playground: Try out the
pay() and getPaymentStatus() functions in our Base Pay SDK Playground before integrating them into your app.Browser (SDK)
Important: The
testnet parameter in getPaymentStatus() must match the value used in the original pay() call. If you initiated a payment on testnet with testnet: true, you must also pass testnet: true when checking its status.
Collect user information (optional)
Need an email, phone, or shipping address at checkout? Pass apayerInfo object:
Server Side
When accepting payments, your backend must validate transactions and user info received from the frontend. This section covers two critical aspects: verifying transaction completion and validating user information.Verify User Transaction
UsegetPaymentStatus() on your backend to confirm that a payment has been completed before fulfilling orders. Never trust payment confirmations from the frontend alone.
Backend (SDK)
Backend (with replay protection)
Validate User Info
If you’re collecting user information (email, phone, shipping address) during checkout, use thecallbackURL parameter to validate this data server-side before the transaction is submitted.
Your callback endpoint receives the user’s information and must respond with either a success or error response:
Backend (validation endpoint)
The callback is invoked before the transaction is submitted. If you return errors, the user is prompted to correct their information. If you return success, the transaction proceeds.
Add the Base Pay Button
Use the pre-built component for a native look-and-feel:Checkout.tsx
Test on Base Sepolia
- Get test USDC from the Circle Faucet (select “Base Sepolia”).
- Pass
testnet: truein yourpay()andgetPaymentStatus()calls. - Use Sepolia BaseScan to watch the transaction.