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

Prop
Type
Description
Example

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

Prop
Type
Description
Default

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 Handler Types

🔧 Optional Customization Props

Chain & Token Preferences

Prop
Type
Description

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 with getAddress()

  • Stellar USDC: Use rozoStellarUSDC.chainId (1500), rozoStellarUSDC.token, and Stellar address (no getAddress() needed)

For a complete list of supported payout chains and tokens, see Supported Tokens and Chains.

UI Customization

Prop
Type
Description
Options

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

Prop
Type
Description

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

Prop
Type
Description
Default

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:

Prop
Type
Description

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 modal

  • hide() - 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:

  • toUnits accepts human-readable amounts as strings (e.g., "10" for 10 USDC, no parseFloat needed)

  • You must call resetPayment() whenever toChain, toAddress, toToken, or toUnits values change

  • Use useRozoPayUI() hook to access the resetPayment function

📖 Next Steps

Last updated