---
title: Parameters
description: Prefill the sell widget, and confirm the transfer.
---

The prefill calls below go straight after `init`, in the same script: they are
read once, when the widget loads. The transaction calls further down answer the
widget while the customer is selling.

## Currencies

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

## Lock the coin

Makes the coin read-only, so the customer cannot pick another:

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

## Order information

Prefill both currencies and an amount, in crypto or in fiat:

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

## Transaction confirmation

When the customer confirms, the widget asks your app to send the crypto (see
[events](https://partner.btcdirect.eu/v2/widget/sell/events.md)). Once the transfer is broadcast and has a
transaction id, tell the widget, which adds it to the order:

```js
btcdirect('transaction-id-confirmation', {
  orderId: '3f2b8c1e-…',
  transactionId: 'abcdef-123456789'
});
```

### Cancelling

If the transfer cannot go ahead, for example because the wallet holds too little,
or the customer cancels it, cancel the order:

```js
btcdirect('coin-to-fiat-order-canceled');
```

> **Order updates**
>
> Order updates reach you through [webhooks](https://partner.btcdirect.eu/v2/webhooks.md), configured once for your
> account. An integration that already calls `callback` with a per-order URL keeps
> receiving updates there, once your account manager has enabled it.
