Overview
- Activate payment mode (biometric gate, integrator-triggered)
- Listen for a SonicPay audio signal
- Review the payment details
- Sign the transaction locally and submit via Cherp
Step 1: Listen for audio
Once the user activates payment mode, open the microphone and listen for SonicPay audio:Step 2: Handle the received intent
You can use the default UI or build a custom one:Default UI
The SDK renders a native bottom sheet with payment details and a confirm button:Headless mode
Render your own UI and callsdk.confirm() when the user is ready:
What happens internally
When the fulfiller confirms:POST /v1/intents/:id/detected— signals the requestor SDK that a payer was foundGET /v1/intents/:id— fetches the full intent detailsPOST /v1/intents/:id/build— gets the unsigned transaction blob (includes ATA check on Solana)wallet.signTransaction(blob)— the wallet signs locally, private key never leaves the devicePOST /v1/intents/:id/submit— Cherp broadcasts to chain- SDK listens via SSE for
confirmedstate
Retry handling
On Solana, transactions can be dropped if they expire (~60s). When this happens:- The intent resets to
createdwithretryRequired: true - The SDK surfaces a re-sign prompt to the fulfiller
- A new transaction is built with a fresh blockhash