import { pay } from '@base-org/account';

const result = await pay({
  amount: "10.50",
  to: "0x1234567890123456789012345678901234567890",
  testnet: false
});
{
  success: true,
  id: "0xabcd1234...",
  amount: "10.50",
  to: "0x1234567890123456789012345678901234567890",
  payerInfoResponses: {
    email: "user@example.com"
  }
}
Defined in the Base Account SDK
The pay function is the core method of Base Pay that lets your users send USDC (digital dollars) on the Base network. No crypto knowledge required - we handle all the complexity. No fees for merchants or users.

Parameters

amount
string
required
Amount of USDC to send (e.g., “10.50” or “0.01”).
to
string
required
Ethereum address to send USDC to (must start with 0x).Pattern: ^0x[0-9a-fA-F]{40}$
testnet
boolean
Set to true to use Base Sepolia testnet instead of mainnet. Default: false
payerInfo
object
Optional payer information configuration for data callbacks.

Returns

result
PayResult
Payment result indicating success or failure.
import { pay } from '@base-org/account';

const result = await pay({
  amount: "10.50",
  to: "0x1234567890123456789012345678901234567890",
  testnet: false
});
{
  success: true,
  id: "0xabcd1234...",
  amount: "10.50",
  to: "0x1234567890123456789012345678901234567890",
  payerInfoResponses: {
    email: "user@example.com"
  }
}

Error Handling

Always wrap calls to pay in a try-catch block to handle these errors gracefully.