API Reference
Complete reference for RozoAI Intent Pay SDK props, configuration, and customization options.
📋 Core Props (ALWAYS REQUIRED)
<RozoPayButton
appId="rozoDemo" // Demo app ID
toChain={8453} // Base chain ID
toAddress={getAddress("0x...")} // Your wallet address
toToken={getAddress(baseUSDC.token)} // USDC token
toUnits="10" // $10 USDC (optional)
intent="Pay Now" // Button text (optional)
/>Required Props
appId
string
Your app identifier
"rozoDemo"
toChain
number
Destination chain ID
8453 (Base)
toAddress
Address
Your wallet address
getAddress("0x742d...")
toToken
Address
Token contract address
getAddress(baseUSDC.token)
Semi-Optional Props
toUnits
string
Human-readable amount as string (e.g., "10" for 10 USDC, no parseFloat needed). If not provided, user prompted.
-
intent
string
Button text/payment verb
"Pay"
🎯 Event Handlers (RECOMMENDED)
Event Handler Types
🔧 Optional Customization Props
Chain & Token Preferences
preferredChains
number[]
Preferred chain IDs in order
preferredTokens
TokenPreference[]
Preferred tokens with chain/address
Stellar Payout Support
For Stellar USDC payouts, use rozoStellarUSDC from @rozoai/intent-common:
Available Payout Options:
Base USDC: Use
baseUSDC.chainId(8453),baseUSDC.token, and Base address withgetAddress()Stellar USDC: Use
rozoStellarUSDC.chainId(1500),rozoStellarUSDC.token, and Stellar address (nogetAddress()needed)
For a complete list of supported payout chains and tokens, see Supported Tokens and Chains.
UI Customization
theme
string
Built-in theme
"minimal", "rounded", "retro", "midnight", "web95", "soft", "nouns", "auto"
mode
string
Color mode
"light", "dark", "auto"
disabled
boolean
Button state
true, false
className
string
Custom CSS class
Any valid CSS class
Advanced Configuration
metadata
Record<string, any>
Custom data to include with payment
externalId
string
Your internal tracking identifier
toCallData
Hex
Optional calldata for contract calls
evmChains
number[]
Restrict payments to specific EVM chains
refundAddress
Address
Address to receive refunds if needed
🎨 Built-in Themes
Theme Options
Custom Styling
🎆 Modal Control & Behavior
Modal Options
defaultOpen
boolean
Open modal automatically when component mounts
false
closeOnSuccess
boolean
Close modal after successful payment
false
resetOnSuccess
boolean
Reset payment state after success
true
connectedWalletOnly
boolean
Skip to wallet tokens (embedded flows)
false
confirmationMessage
string
Custom message on confirmation screen
-
redirectReturnUrl
string
Return URL for external payment providers
-
showProcessingPayout
boolean
Show processing state after payment completion
false
onOpen
function
Called when modal opens
-
onClose
function
Called when modal closes
-
🚀 Alternative: Pre-created Payments
Using PayId
For server-side payment creation, use the payId prop instead:
payId
string
Pre-created payment ID
⚠️ IMPORTANT: You must specify EITHER appId (with payment params) OR payId, but not both.
🎨 Custom Component Variant
RozoPayButton.Custom
For complete UI control, use the Custom variant with a render prop:
Render Props:
show()- Function to open the payment modalhide()- Function to close the payment modal
🔍 TypeScript Types
Core Types
🔄 Dynamic Payment Updates
Using resetPayment() Hook
When payment parameters (toChain, toAddress, toToken, or toUnits) change dynamically, you must call resetPayment() from the useRozoPayUI() hook:
Important Notes:
toUnitsaccepts human-readable amounts as strings (e.g.,"10"for 10 USDC, noparseFloatneeded)You must call
resetPayment()whenevertoChain,toAddress,toToken, ortoUnitsvalues changeUse
useRozoPayUI()hook to access theresetPaymentfunction
📖 Next Steps
View complete examples for implementation patterns
Check troubleshooting guide for common issues
Use AI prompts for code generation
Last updated