Add Funds Embed

Drop a single <iframe> into your app and your users can load their wallet without you building any payment UI. The hosted flow handles amount selection, payment method (Pay by Bank via Plaid Hosted Link, or card), and confirmation. Your app renders the screen title and exit button; the iframe is the body.

Prerequisites

  • The user must exist — call POST /v1/users:upsert on sign-in and store the returned id.
  • You need a V1 API key issued by Uptop. The API key stays on your server — it is exchanged for a short-lived token before the iframe URL is constructed.

Authentication

Your backend exchanges the API key for a short-lived JWT and passes it to the client as iframeToken. The API key never leaves your server.

Your backend (Node example)
// Exchange API key for a short-lived iframe token (10 min)
const { accessToken } = await fetch(
  `${UPTOP_API_BASE}/v1/users/${userId}/auth/client-token`,
  { method: 'POST', headers: { 'Api-Key': process.env.UPTOP_API_KEY } }
).then(r => r.json());

// Return accessToken to the client — never the raw API key
return { iframeToken: accessToken };

Try it — fetch a token to activate the live preview:

POST/v1/users/{userId}/auth/client-token

Set your API Key and User ID in settings to fetch a token.

Embed Code

HTML
<iframe
  src="https://insomniac-docs.uptop.xyz/embed/add-funds?userId={USER_ID}&iframeToken={TOKEN}"
  width="390"
  height="844"
  style="border:none;"
  allow="payment"
></iframe>

Live Preview

No preview

Set your API Key and User ID in settings, then fetch a token in the Authentication section.