Quickstart

Quickstart · Web non-custodial (Stellar)

Get a sandbox cash-out working in about 15 minutes: session endpoint, iframe SDK, and Stellar USDC signing (including memo when required).

~15 minWeb · StellarUSDC

Quickstart · Web non-custodial (Stellar / USDC)

Time: about 15 minutes · Success: sandbox cash-out opens the widget, signs a Stellar USDC transfer (with memo when required), and returns a reference number.

Before you start

  • Credentials & environments: sandbox ramps_pk_sbox_ / ramps_sk_sbox_ keys (same model as Solana)
  • Domain allowlisted for sandbox
  • Stellar only: wallet with testnet USDC (issuer GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 on testnet)

Wrong track? Custodial hot wallet → Custodial Quickstart. React Native → RN Quickstart. Legacy SEP anchor → SEP guide.

Never call the session API from the browser with your secret key. Shared rules: Getting started.

Stellar only · session body

TypeScript
// Node / Next.js route handler (sketch)export async function POST(req: Request) {  const { walletAddress } = await req.json()   const res = await fetch('https://playground.xramps.moneygram.com/api/v1/sessions', {    method: 'POST',    headers: {      'Content-Type': 'application/json',      'x-api-key': process.env.RAMPS_SECRET_KEY!, // ramps_sk_sbox_...    },    body: JSON.stringify({      walletAddress, // G... address of the end user      chain: 'stellar',    }),  })  if (!res.ok) throw new Error(await res.text())  return Response.json(await res.json())}

Load the SDK via script tag (it is not published to npm):

HTML
<script src="https://playground.xramps.moneygram.com/sdk/index.global.js"></script>
TypeScript
const { createRamps } = window.RampsSDK const session = await fetch('/api/ramps-session', {  method: 'POST',  headers: { 'Content-Type': 'application/json' },  body: JSON.stringify({ walletAddress: userGAddress }),}).then((r) => r.json()) const ramps = createRamps({  container: document.getElementById('ramps-widget'),  sessionToken: session.sessionToken,  widgetUrl: session.widgetUrl, // already includes ?mode=off-ramp for cash-out  wallet: {    address: userGAddress,    chain: 'stellar',    asset: 'USDC',    walletType: 'non-custodial',  },  onSignTransaction: async (tx) => {    // Sign the Stellar USDC payment with the user wallet (see full guide)    const txHash = await signStellarUsdcTransfer(tx)    return txHash // Stellar transaction hash string  },  onComplete: (result) => {    console.log('referenceNumber', result.referenceNumber)  },  onError: (err) => console.error(err),}) ramps.open()
  • Widget iframe opens without origin / allowlist errors
  • User completes KYC + quote in sandbox
  • onSignTransaction fires with deposit G-address, amount, and often a memo
  • You return a transaction hash; widget shows a reference number

4. Go deeper