v2
You are reading v1 & v2. v1 and v2 are deprecated. They keep working and are still supported, but new integrations should use v3.

Parameters

Prefill and lock parts of the buy widget's order form.

These calls prefill the order form. Make them straight after init, in the same script: they are read once, when the widget loads.

Set parameters

btcdirect('set-parameters', {
  baseCurrency: 'BTC',
  quoteCurrency: 'EUR',
  quoteCurrencyAmount: 123,
  paymentMethod: 'creditCard',
  walletAddress: 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq',
  returnUrl: 'https://example.com',
  partnerOrderIdentifier: '12345abcde',
  fixedAmount: true,
  fixedCurrency: true,
  fixedPaymentMethod: true,
  showWalletAddress: true
});

Every field is optional; pass only what you want to prefill.

baseCurrencyoptional

string

The coin to preselect, by ticker.

quoteCurrencyoptional

string

The fiat currency to preselect.

baseCurrencyAmountoptional

number

The crypto amount to prefill.

quoteCurrencyAmountoptional

number

The fiat amount to prefill. When both amounts are set, this one is used.

paymentMethodoptional

string

The payment method to preselect.

walletAddressoptional

string

The customer’s wallet address.

walletAddressTagoptional

string

Its destination tag, for coins that use one.

returnUrloptional

string

Where the "Back to partner" button goes. Overrides the init option.

partnerOrderIdentifieroptional

string

Your own reference for the order.

fixedAmountoptional

boolean

Lock the amounts.

fixedCurrencyoptional

boolean

Lock the currencies.

fixedPaymentMethodoptional

boolean

Lock the payment method.

showWalletAddressoptional

boolean

false hides the wallet address on the form.

Order updates and your fee

Order updates reach you through webhooks, configured once for your account rather than per order. An integration that already passes a per-order callbackUrl keeps receiving updates there, once your account manager has enabled it. Your fee is set on your account: a fee sent from the browser is not one we can trust, so fee is ignored.

Other calls

Currencies

btcdirect('currencies', { crypto: 'BTC', fiat: 'EUR' });

Lock the coin

btcdirect('currencies', { crypto: 'ETH', fiat: 'EUR' });
btcdirect('lock-cryptocurrency', { lockCryptocurrency: true });

Prefill the order

btcdirect('order', {
  crypto: 'LTC',
  fiat: 'EUR',
  amount: 1,
  type: 'crypto' // or 'fiat'
});

Payment method

btcdirect('payment-method', { method: 'iDeal' });

Skip the order form

When the amount, currency, wallet address and payment method are all provided, go straight to confirming the order:

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

Include a DCA tab

Adds a recurring-purchase tab beside the buy form:

btcdirect('include-dca', { include: true });

Your order reference

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