Use the MoonPay Platform APIs, SDKs, and frames to build crypto ramps directly in your app. Before you start, review the requirements and core concepts.
On your frontend, check whether the customer has an active connection. If they do, you receive credentials for the next steps.
import { createClient } from "@moonpay/platform";// Create the client with your session tokenconst clientResult = createClient({ sessionToken: "c3N0XzAwMQ==", // The session token from your server});if (!clientResult.ok) { // Handle error creating client}const client = clientResult.value;// Check if the customer has an active connectionconst connectionResult = await client.getConnection();if (!connectionResult.ok) { // Handle error}console.log(connectionResult.value);
3
List payment methods
List the payment methods available to the customer at the current time.
List payment methods
// After connecting, list available payment methodsconst paymentMethodsResult = await client.getPaymentMethods();if (!paymentMethodsResult.ok) { // Handle error}console.log(paymentMethodsResult.value);// [{ type: "apple_pay", capabilities: {...}, availability: {...} }, ...]
4
Get quotes
Get quotes with detailed fees and limits for transactions.
Get quotes
const quoteResult = await client.getQuote({ source: "USD", // The fiat currency for payment destination: "ETH", // The crypto the customer will receive sourceAmount: "100.00", // The amount to purchase walletAddress: "0x...", // The destination wallet address paymentMethod: "apple_pay",});if (!quoteResult.ok) { // Handle error}console.log(quoteResult.value);// { signature: "...", expiresAt: "2026-01-12T14:45:00Z", ... }