// In your API route handler:
const response = await fetch("https://api.daimo.com/v1/sessions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.DAIMO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
destination: {
type: "evm",
address: "0xYourAddress",
chainId: 8453, // Base
tokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC
amountUnits: "10.00", // $10 USDC
},
display: {
title: "Deposit to Acme",
verb: "Deposit",
},
}),
});
const { session } = await response.json();
// Return session.clientSecret and session.sessionId to the frontend