Skip to main content

Method Signature

align.transfers.listOnrampTransfers(
  customerId: string
): Promise<TransferListResponse>

Parameters

customerId
string
required
The unique customer identifier (UUID format)

Returns

items
Transfer[]
Array of onramp transfer objects

Examples

import Align from "@tolbel/align";

const align = new Align({
  apiKey: process.env.ALIGN_API_KEY!,
  environment: "sandbox",
});

const response = await align.transfers.listOnrampTransfers(
  "123e4567-e89b-12d3-a456-426614174000"
);

console.log(`Total onramp transfers: ${response.items.length}`);

for (const transfer of response.items) {
  console.log(`${transfer.id}: ${transfer.status}`);
  console.log(`  $${transfer.source_amount} USD → ${transfer.destination_amount} USDC`);
}

Filter by Status

const response = await align.transfers.listOnrampTransfers(customerId);

// Get only completed onramps
const completed = response.items.filter((t) => t.status === "completed");

// Calculate total fiat spent
const totalSpent = completed.reduce(
  (sum, t) => sum + parseFloat(t.source_amount),
  0
);

console.log(`Total fiat spent: $${totalSpent} USD`);