USDC Payments API for StarkNet
Accept USDC payments in your app with Chipi's gasless payment flow. Support Chipi wallet and external wallet checkout with webhook verification. Full React integration guide.
Overview
Accept USDC stablecoin payments in your app with two checkout paths: users with Chipi wallets pay instantly in-app with a passkey tap, while non-Chipi users pay via external wallets (MetaMask, Argent X) through a hosted checkout. Webhook notifications confirm every payment on-chain. You never miss a settled transaction.
Set Up Your Merchant Wallet
Add your StarkNet merchant wallet address to your environment:
bashNEXT_PUBLIC_MERCHANT_WALLET=0x_YOUR_STARKNET_ADDRESSThis is the address that receives all payments. Chipi never holds the funds. USDC goes directly from the buyer to your wallet.
Add the Payment Component
Use the PayWithCryptoCard component which provides:
- - PayWithChipiButton. Pay using the user's Chipi wallet with passkey confirmation
- - PayWithExternalWalletButton. Redirect to external wallet for non-Chipi users
Two payment paths ensure you don't lose customers who don't have a Chipi wallet yet.
Set Up Webhook Verification
Create an API route to receive payment notifications from Chipi:
- Verify the HMAC-SHA256 signature using the
chipi-signatureheader - Use your
CHIPI_SECRET_KEY(sk_prod_) for signature verification - Process the payment: update order status, send confirmation email, fulfill the service
The webhook is your source of truth for completed payments. Never rely on client-side success callbacks alone. Webhooks confirm the transaction was actually settled on-chain. Always verify the HMAC signature to prove the webhook came from Chipi.
Key Rules
- - USDC has 6 decimals. $10.00 = 10000000 in raw format
- - Always verify webhook signatures with HMAC-SHA256
- - The
sk_prod_key is secret. Never expose it to client/frontend code - - External wallet payments redirect to pay.chipipay.com
- - All Chipi wallet payments are gasless