The CRYPTOMENTS Widget SDK is a JavaScript library that lets you embed a crypto payment UI into partner websites with minimal effort. Deposits, withdrawals, Axim Pay, payment links — all available as iframes or popups.
Doc version: 2.0Last updated: March 30, 2026CDN: https://widget.cryptoments.cc/sdk/widget.cryptoments.js
1Overview
CryptoPaymentsWidget is a JavaScript SDK that lets you embed a crypto payment UI into partner websites with minimal effort.
Screen flows per widget type and the features of each view.
Deposit
The widget where users deposit USDT. The user picks a payment method (Axim Pay / Direct crypto deposit / KRW top-up payment), receives a deposit address, and sends.
Enter amount→Choose payment method→[ Axim Pay ]→App connect & proceed→Success/Failure
Enter amount→Choose payment method→[ Direct crypto payment ]→Pick network + address→Awaiting deposit
Enter amount→Choose payment method→[ KRW top-up ]→Connect & eKYC→Pre-match confirm→Bank transfer (1–3 split accounts)→Awaiting verification→Complete / Dispute
When no P2P counterpart is available, the flow automatically falls back to a TORQ LP full-amount top-up (single LP).
Axim Pay
Enter amount→Choose payment method→[ Axim Pay ]→App connect & proceed→Success/Failure
① Enter Amount
The first screen, where the user enters the KRW amount to deposit. The USDT amount is computed from the exchange rate.
KRW ↔ USDT two-way input (changing one auto-updates the other)
Live rate (1 USDT = N KRW)
Quick amount buttons shown when amountOptions is set
Min/max amount guide (from API or parameters)
If allowAmountEdit: false, the amount input is disabled
With presetAmount + skipInput: true, this screen is skipped
② Choose Payment Method
The screen where the user picks a payment method.
Axim Pay (recommended): pay via the Axim Wallet app, no gas fees Shown only when aximEnabled: true
Direct crypto payment: send directly from a personal wallet or exchange
KRW top-up payment: top up USDT via KRW bank transfer through P2P cross-site matching (falls back to a TORQ LP when no match is found) Shown by default. Requires a KRW amount input (minimum 10,000 KRW)
Fixed Amount Mode skipInput + presetAmount
If skipInput: true and presetAmount is valid, the amount card is shown together
The [ ① Enter Amount ] screen is skipped and this screen is shown instead
If amount is not set (skipInput: true, no presetAmount), the button is disabled and an error is shown
③ Axim Pay App Connect
After picking Axim Pay, the screen varies by user environment.
Mobile: "Please confirm in the Axim Wallet app" — the app launches automatically; the screen advances on approval
Desktop: QR code shown — scan with the Axim Wallet app and approve
If Axim Wallet is not installed, the "About Axim Pay" link opens the install guide
④ Axim Pay Payment Request
The screen where the user confirms the amount and network, then sends a payment request to the Axim Wallet app.
Shows the amount (KRW/USDT) and the applied rate
Payment network dropdown (chain can be changed)
Clicking "Request Payment" sends a payment notification to the Axim Wallet app
"Change Payment Method" returns to the previous step
⑤ Axim Pay Awaiting Approval / Result
After sending the payment notification, the widget waits for the user's approval and transitions to success/failure based on the result.
Awaits approval after sending the payment notification (axim-wallet-confirm)
Success: "Payment complete", auto-closes
Failure/Rejected: shows reason, "Retry" button
"Open in app" deep-link button (mobile); "Cancel Payment" stops the payment
Events:
aximPaymentSuccess: fired on approval in the app
aximPaymentFailed: fired on rejection or timeout
depositCompleted: fired on final deposit completion
Direct Crypto Payment
Enter amount→Choose payment method→[ Direct crypto payment ]→Pick network + address→Awaiting deposit
Pick Network + Deposit Address
When the user picks Direct Crypto Payment, this screen shows the network choice and the deposit address.
The deposit branch entered when the user picks KRW top-up payment on the payment method screen. After wallet connect and eKYC, the request is routed through P2P cross-site matching: the user is matched with one or more sellers (LPs) and sends KRW by bank transfer to each matched account, then the USDT is credited. This card is shown by default (no option needed).
P2P matching & TORQ fallback — When a P2P counterpart with enough remaining liquidity exists, the top-up is fulfilled via P2P (possibly split across up to 3 accounts). When there is no match or insufficient liquidity, the flow automatically falls back to a TORQ LP full-amount top-up (single LP). The user experience is the same; only the settlement source differs.
① Axim Wallet Connect
The user must connect the Axim Wallet first. The screen varies by environment.
Mobile: the Axim Wallet app launches automatically; the screen advances on connect
Desktop: a QR code is shown — scan with the Axim Wallet app to connect
The "About Axim Pay" link opens an info screen (features, install & first-visit guide, QR)
Connection status is polled; once connected, the flow advances automatically
The verification status is polled; the screen advances automatically once complete
Already-verified users skip this screen
③ Pre-match Confirm
Before matching starts, a confirmation screen summarizes the trade.
Payment amount (KRW), expected USDT to receive (net of fee), market FX rate, fee rate (%)
Minimum 10,000 KRW — amounts below this are rejected
A notice card explains the transfer time limit and own-account requirement
"Start trade" begins matching; "Cancel" returns to the payment-method screen (the widget stays open)
④ Transfer Instructions (1–3 split accounts)
The matched seller account(s) are displayed; the user sends KRW to each. A large top-up may be split across up to 3 accounts.
Matching runs instantly after "Start trade" (a brief spinner shows on this screen until the matched accounts appear; no separate matching screen)
Each match card shows bank / account number / holder / amount and a status badge
Status flow per account: waiting transfer → verifying → confirmed → settled
Progress indicator (e.g. 1/3) when split across multiple accounts
Tap "Transfer complete" on each account after sending (only shown while still waiting)
A red notice requires transfers from the user's own (eKYC-verified) bank account only
Transfer deadline countdown; "Cancel all" ends remaining un-transferred legs
⑤ Awaiting Verification → Complete
Once all active matches are confirmed, the widget waits for final settlement.
Each match is verified by the seller; the order auto-completes when all confirm
Complete: the topped-up USDT amount and order code are shown; the p2pTopupCompleted event fires (torqTopupCompleted for the TORQ fallback path)
Dispute
If a transferred leg is not confirmed in time, the screen transitions to dispute reporting (the user who already sent funds is protected).
Submit evidence: transfer screenshot (image, ≤ 5 MB) + a short statement
1-hour submission limit; after submitting, an "under review" screen is shown
On expiry / cancellation / no liquidity (NO_LP) the screen shows a failure state with a "Retry" button
Withdrawal
The widget where the user requests a USDT withdrawal to an external wallet. Withdrawals are processed after partner-side approval.
JavaScript
await widget.openWithdrawal('user_001', {
// Amount
presetAmount: 50000, // Preset amount
presetAmountCurrency: 'KRW', // preset unit: 'KRW' | 'USD' (default 'USD')
minAmount: 10, // Minimum amount (USDT basis, default 10)
maxAmount: 100000, // Maximum amount (USDT basis, default 100000)
allowAmountEdit: true, // Allow manual amount edit (default true)
fixedRateKrw: 1400, // Fixed FX rate (defaults to live rate if unset)// Network
chainType: 'BSC', // Pin network (defaults to user choice if unset)// UX
skipInput: false, // true: skip the amount input (presetAmount required)
showBalance: true, // Show available balance (default true)// Withdrawal request callback (required)
reqWithdraw: async (data) => {
// data: { userId, chainType, currencyType, toAddress, amountCrypto, amountKrw, exchangeRate }const res = awaitfetch('/api/withdraw', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
const result = await res.json();
return result.success === true; // return true on success, false/throw to show the failure screen
}
});
⚠️
The reqWithdraw callback is required. Without it, the widget will not open.
Returning true → success screen + onSuccess callback. Returning false or throwing → failure screen.
The SDK manages tokens automatically. You don't need to implement a token-refresh path of your own.
9FAQ & Troubleshooting
Common issues and how to resolve them.
The widget doesn't open
Verify the SDK loaded successfully
Verify the CryptoPaymentsWidget object exists
Check the browser console (F12) for errors
Verify the partnerApiUrl server is responding normally
Events don't fire
Verify the listener is registered via addEventListener
Verify the event name is correct (case-sensitive)
Verify the listener is registered before opening the widget
Inspect the full flow via the message event
JavaScript
// For debugging (see all events)
widget.addEventListener('message', (e) => {
console.log('EVENT:', e);
});
Token-related errors
Verify the server's partnerApiUrl endpoint is operating correctly
Verify the API Key / Secret are correct
Verify the server time is accurate (to avoid timestamp errors)
ℹ️
The SDK requests and manages tokens automatically. You don't need to handle tokens manually on the client.
CORS errors
Verify the current domain is in the allowed Whitelist
Verify the protocol is included (https://)
After configuration changes, allow some propagation time
Deposits aren't being detected
Verify you sent on the correct network (chain)
Verify the deposit address is correct
Verify the amount meets the minimum
Allow on-chain confirmation time (typically 1–5 minutes)
Withdrawals fail
Verify reqWithdraw is implemented
Verify your server API is responding normally
Verify the balance is sufficient
Verify the wallet address is correct
KRW top-up payment doesn't proceed
The "KRW top-up payment" card is shown by default. If it's disabled (un-clickable), verify a KRW amount has been entered — the card requires an amount to be active
KRW top-up requires wallet connect + eKYC first. If the flow is stuck on the connect / eKYC screen, complete connection and verification in the Axim Wallet app (both are polled and advance automatically)
When the pre-match step looks like a "CORS error": it's usually not actually CORS but a 502 from upstream because the amount is below the 10,000 KRW minimum. Enter 10,000 KRW or more.
If it lands on a failure screen with NO_LP (no liquidity), no P2P counterpart was available and the TORQ LP fallback also had no liquidity — retry later
If "Verifying" persists after a transfer, you're waiting for the seller (LP) to confirm the deposit (test transfers don't actually arrive and won't complete)