Skip to content

Buy widget: parameters

You can prefill and control the buy widget by calling set-parameters after initialization.

btcdirect('set-parameters', {
baseCurrency: 'BTC',
quoteCurrency: 'EUR',
baseCurrencyAmount: 0.001,
quoteCurrencyAmount: 123,
paymentMethod: 'creditCard',
walletAddress: '3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5',
walletAddressTag: '1513155290',
signature: '67890fghij',
returnUrl: 'https://example.com',
callbackUrl: 'https://example.com/callback',
partnerOrderIdentifier: '12345abcde',
fee: 0.5,
expiryDateTime: 1701423182,
fixedAmount: true,
fixedCurrency: true,
fixedPaymentMethod: true,
showWalletAddress: true
});

All parameters are optional. Only provide the fields you want to prefill.

KeyTypeDescription
baseCurrencystringThe cryptocurrency to preselect
quoteCurrencystringThe fiat currency to preselect
baseCurrencyAmountnumberThe crypto amount to prefill
quoteCurrencyAmountnumberThe fiat amount to prefill
paymentMethodstringThe payment method to preselect. See payment methods.
walletAddressstringThe wallet address of the user
walletAddressTagstringThe destination tag of the wallet (if applicable)
signaturestringSignature from an offer API call (see below)
returnUrlstringURL to return to when clicking “Back to partner”
callbackUrlstringURL where order status updates are sent
partnerOrderIdentifierstringYour order ID
feenumberA specific fee for this order (as a percentage)
expiryDateTimestringUnix timestamp from an offer API call (see below)
fixedAmountbooleanLock the amounts so they cannot be changed
fixedCurrencybooleanLock the currencies so they cannot be changed
fixedPaymentMethodbooleanLock the payment method so it cannot be changed
showWalletAddressbooleanShow or hide the wallet address of the user

The signature and expiryDateTime parameters come from the Unified Checkout API response. Providing them ensures the same offer is used for the order.

btcdirect('locale', { locale: 'en-GB' });
btcdirect('currencies', { crypto: 'BTC', fiat: 'EUR' });
btcdirect('currencies', { crypto: 'ETH', fiat: 'EUR' });
btcdirect('lock-cryptocurrency', { lockCryptocurrency: true });
btcdirect('order', {
crypto: 'LTC',
fiat: 'EUR',
amount: 1,
type: 'crypto' // or 'fiat'
});
btcdirect('payment-method', { method: 'iDeal' });
btcdirect('callback', { callbackUrl: 'https://example.com/callback' });

Skips the order form if all required data is provided (amount, currency, wallet address, payment method):

btcdirect('attempt-direct-confirm', { enableAttemptDirectConfirm: true });

Adds a Dollar Cost Averaging tab to the buy widget:

btcdirect('include-dca', { include: true });
btcdirect('partner-order-identifier', { partnerOrderIdentifier: '12345abcde' });