---
title: Events
description: What the sell widget tells your page when the crypto has to be sent.
---

Listen on `window`; the data is in `event.detail`:

```js
window.addEventListener('EVENT_NAME', (event) => {
  console.log(event.detail);
});
```

## Order requested

The customer confirmed the sale. `detail` is everything your app needs to send
the crypto.

Event name: `btcdirect-embeddable-coin-to-fiat-order-requested`

```js
// event.detail
{
  currency: 'BTC',
  amount: 0.1,
  walletAddress: 'bc1q…',
  destinationTag: '',
  orderId: '3f2b8c1e-…',
  userWalletAddress: 'bc1q…',
  userWalletIdentifier: '123456789'
}
```

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `currency` | string | optional | The coin’s ticker. |
| `amount` | number | optional | How much to send. |
| `walletAddress` | string | optional | Our address: where to send it. |
| `destinationTag` | string | optional | The memo or destination tag that must travel with the transfer, for coins that use one. Empty otherwise. |
| `orderId` | string | optional | The order. Quote it back in transaction-id-confirmation. |
| `userWalletAddress` | string | optional | The customer’s wallet the crypto comes from, when you passed wallet addresses. Empty otherwise. |
| `userWalletIdentifier` | string | optional | The id you gave that wallet. Empty otherwise. |

The customer’s wallet fields are filled when you passed
[wallet addresses](https://partner.btcdirect.eu/v2/widget/buy/wallet-addresses.md).

Then send the transfer and report its transaction id:
[transaction confirmation](https://partner.btcdirect.eu/v2/widget/sell/parameters.md#transaction-confirmation).

The [account events](https://partner.btcdirect.eu/v2/widget/buy/events.md#account-events) are sent here too.
