Before going live, you’re required to complete KYB verification via the dashboard. Alternatively, get a link from your MP Account Manager.Note: KYB is not required to start the integration process.
1. Create your Deposit
Create a deposit via the Create Deposit endpoint or the dashboard. Upon creation, adepositId will be returned. Configure the following options:
- Deposit Name: Assign a unique name to the deposit. Within this section, you can:
- Recipient Currency: Specify the blockchain/currency in which you wish to receive fund
- Payment Options: Enable Transfer Manually, Connect Wallet, Connect Exchange, Bank Transfer and Add Money.
- Customisation: Update badges and CTA (Call to Action) copy
- Notifications: Enable email notifications to receive updates when a deposit is successfully completed.
Payment Options
When creating a deposit, you can enable any combination of the following payment options:- Transfer Manually — Displays a QR code and wallet address for the user to send funds to directly.
- Connect Wallet — Lets users connect their crypto wallet, reads their balance, and allows them to send funds without manually copying addresses or scanning QR codes.
- Connect Exchange — Lets users connect a supported centralized exchange and transfer funds directly from their exchange balance.
- Add Money — Enables fiat on-ramp via card, Apple Pay, or Google Pay. Requires API keys from either MoonPay Ramps or Onramper to be configured under Settings → Integrations.
- For Onramper, first-time users can sign up via their unique affiliate link to have the subscription fee waived.
- Bank Transfer — Creates a Virtual Account on behalf of the user which allows users to fund via bank transfer (SEPA, ACH, etc.) where supported. Availability depends on the user’s region.
2. Create a Deposit Customer
Generate a Deposit Customer via the API and their associated deposit addresses across SVM, EVM, and BTC networks.- Required Parameters: To create a customer, you must specify a unique
customerId, arecipientWallet, and any optional metadata via theadditionalJsonpayload. - Save the token: Store the returned Deposit Customer token. This token allows you to reuse the same deposit address for subsequent transactions from the same customer.
- Related endpoints: use the Update Deposit Customer and Get Deposit Customer endpoints as needed.
- Test Customer Deposit Session: In this step you can simulate a deposit widget. You must define a
customerIdand arecipientWalletto generate the test environment.
3. Build Your Own or Serve our Deposit UI in Your App
Headless support
- Serve deposit addresses in your own UI. Create and store the
depositCustomerToken-> use the Get Deposit Customer endpoint to get thedepositWalletsarray - Use Record Deposit Wallet Activity (By Token) when you have the customer deposit token and want all of that customer’s wallets marked active, or Record Deposit Wallet Activity (By Public Keys) when you display specific wallet addresses. Both increase balance polling so incoming payments are detected more quickly
- Use Get Deposit Currencies to check available currencies
- The Get Deposit Customer response includes a
swapRoutesarray with all swap paths into the deposit’s payout currency. Each route providesavailable(whether the swap path is currently usable) andminAmountUsd(the minimum deposit amount in USD for that route). Filter out entries whereavailableisfalseso your checkout or picker only surfaces currencies with an active swap path, and useminAmountUsdto enforce or display minimum deposit thresholds per currency.
Deposit Widget Setup
Embed the deposit widget in your app using the following NPM package . The below configuration options are available for customising your deposit widget via config:Use our demo environment to test display and other configurations. Simply toggle to the Deposit view and paste the Deposit Customer token.
display
Controls how the deposit flow is rendered on your page.
- Type:
'inline' | 'button' | 'new-tab' - Default:
'inline' - Required: No
'inline'- Embeds the deposit flow directly in the container element'button'- Renders a button that opens the deposit flow in a modal'new-tab'- Renders a button that opens the deposit flow in a new browser tab
If you enable Add Money and use the deposit widget in inline or button mode, your domain(s) must be whitelisted by MoonPay Ramps. In some cases, this may require additional KYB. You can always use new-tab mode without domain whitelisting, or disable the Pay with Cash option.
network
Specifies the environment for the deposit flow.
- Type:
'test' | 'main' - Default:
'main' - Required: No
'test'- Use the test/sandbox environment for development and testing'main'- Use the production environment for live transactions
themeMode
Specifies the default light/dark mode. Alternatively you can also set a fixed Company Theme (Settings -> Merchant settings) that overrides this config.
- Type:
'dark' | 'light' - Default:
'undefined' - Required: No
'dark'- The widget uses dark mode'light'-The widget uses light mode
If
themeMode is undefined and no Company Theme is set, the deposit flow will automatically match the user’s system light/dark mode.variant
Minimal removes padding and background for inline embeds
- Type:
'default' | 'minimal' - Default:
default - Required: no
'default'– Standard embed with padding and background'minimal'– Removes padding and background for inline embeds
openWalletConnectInNewTab
Controls whether the WalletConnect flow opens in a new browser tab.
- Type: boolean
- Default: false
- Required: No
true– WalletConnect opens in a new browser tabfalse– WalletConnect opens in the current tab or modal
Note: For better UX, consider setting this conditionally (e.g.
openWalletConnectInNewTab={wallet.isConnected}) so a new tab is only opened when needed.forcedStep
Forces the deposit flow to begin at a specific step, skipping any preceding steps in the default deposit journey.
- Type: ‘connect-wallet’ | ‘wallet-display’ | ‘moonpay-onramp’
- Default: undefined
- Required: No
'connect-wallet' — Forces the flow to start at the Connect Wallet step.
'wallet-display' — Forces the flow to start at the Wallet Display step.
'moonpay-onramp' — Forces the flow to start directly at the MoonPay Onramp step.
currentlyConnectedWallet
Allows the host application to pass an already connected user wallet into the deposit flow, surfacing it as an additional selectable option.
- Type: ConnectWalletSelection
- Default: undefined
- Required: No
wallet— The connected wallet provider.blockchain— The chain the wallet address belongs to.address— The connected wallet address.
wallet values (DepositConnectWallet)
'METAMASK','PHANTOM','TRUST_WALLET','WALLET_CONNECT'
blockchain values
'SOL','ETH','BASE','POLYGON','ARBITRUM','BSC','ABSTRACT','HYPERLIQUID'
Embedding the widget inside a React app
Embed the deposit widget in your React application using the Deposit Widget on npm.Optional: Preload Assets with the Provider
To improve load performance, you can optionally wrap your application with theMoonpayCommerceDepositProvider.
The provider preloads the required JavaScript assets ahead of time, so when <MoonpayCommerceDeposit /> renders, it does not need to wait for the scripts to load.
Import
layout.tsx or _app.tsx):
childrenshould include the rest of your application, including any usage of<MoonpayCommerceDeposit />.- This setup is optional. If you do not use the provider, assets will still load automatically when
<MoonpayCommerceDeposit />is rendered.
src URL with your own token returned when creating the customer deposit via the API (e.g. acac3ec9-f8f6-4128-8159-a91e418e2581) to render the correct deposit widget.
Iframe Post Message Events
Our deposit widget emits structured postMessage events that let your application react instantly to lifecycle changes such as completion, errors, or height updates, keeping your interface responsive and in sync without requiring a page reload.
| Event | Payload | When it fires |
|---|---|---|
| onSuccess | {} (empty object) | Deposit flow completed and the merchant has been successfully paid. |
| onError | { message: string } | Something went wrong |
| onHeightChanged | { height: number } (pixels) | The widget needs a new height (e.g. after a step change) |
| onReady | {} (empty object) | Widget has fully initialised and is ready |
Always validate the
event.origin before handling messages from the widget. This ensures you only process events coming from our domain and ignore anything unexpected.4. Use Webhooks to Confirm Deposits on Your Backend
Create a webhook to listen for customer deposit events either in the dashboard under Developer Settings (see here for more information) or via the Create a Deposit Webhook endpoint. UseDEPOSIT_TX_* events to confirm settled deposits, and DEPOSIT_BELOW_MINIMUM to notify users when they have sent funds below the sweep minimum so you can prompt a top-up. Payload examples are in the webhook overview.
