---
title: Attributes
description: Every attribute the widget element reads, and what it is for.
---

The element is configured by attributes, plus one property for the list of
wallets you supply. Credentials, language and journeys are observed, so changing
one after mount takes effect. What you prefill is read once, when the widget
creates the customer's offer: set it before you put the element in the page.

## What you set

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `api-key` | string | required | Your api-key. Read by the browser, which is what a widget key is for: it identifies your integration, it does not authorise spending. |
| `subjects` | string | required | Comma-separated journeys to mount, e.g. offer_fiat_to_coin,onboarding. See Journeys. |
| `locale` | string | optional | Language for the widget’s own copy: nl, en, de, fr or es. Anything we do not ship falls back to English. |
| `theme` | string | optional | dark for the dark theme. Anything else is light. |
| `user-identifier` | string | optional | Your own id for a customer you have already registered with us. Mounts the widget as that person. |
| `anon-session-id` | string | optional | A guest key for a customer who has not signed in yet, so their in-progress trade survives a reload. |
| `acting-as` | string | optional | business to trade on behalf of a company the customer represents. Anything else is the person themselves. |
| `business-id` | string | optional | Which company, when acting-as is business. |

## Prefill the order

For a page that already knows what the customer wants. Each attribute is the
field of the same name in the offer prefill of the REST API, so the values are
the same ones you would send there. Leave one out and the customer chooses.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `currency` | string | optional | The coin, as a ticker such as BTC or as a CAIP-19 id. For a coin on several networks, the CAIP-19 id picks the network. |
| `fiat-currency` | string | optional | The fiat currency, ISO 4217, e.g. EUR. |
| `fiat-amount` | string | optional | The amount in fiat, as a decimal string. Set this or crypto-amount, not both. |
| `crypto-amount` | string | optional | The amount in crypto, as a decimal string. |
| `payment-method` | string | optional | The payment method to preselect. Only applies when the customer can use it. |
| `wallet-address` | string | optional | Where a buy pays out to. |
| `wallet-memo` | string | optional | The memo or destination tag for that address, on the networks that need one. |
| `fixed-currency` | boolean | optional | true locks the coin and the fiat currency, so the customer cannot change them. |
| `fixed-amount` | boolean | optional | true locks the amount. |
| `fixed-payment-method` | boolean | optional | true locks the payment method. |
| `hide-wallet-address` | boolean | optional | true hides the wallet address field, for a page that supplies the address itself. |
| `direct-confirm` | boolean | optional | true submits the form as soon as everything is filled in, for a page that prefilled all of it. The customer starts on the next screen. |

```html
<btcdirect-journey
  api-key="API_KEY"
  subjects="offer_fiat_to_coin,onboarding"
  currency="BTC"
  fiat-currency="EUR"
  fiat-amount="100"
  fixed-currency="true"
></btcdirect-journey>
```

## Your order reference and the way back

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `partner-order-identifier` | string | optional | Your own reference for this trade. It is stored with the order and comes back on its webhooks, so your systems can reconcile. |
| `return-url` | string | optional | Where the button on the final screen takes the customer: back to your page or app. It is not where a bank returns after paying; the widget handles that itself. |
| `closable` | boolean | optional | true adds a Close button to the screens where the customer is done, and dispatches btcdirect:close when it is pressed. Only set it if you listen for that event. |

## Wallets you supply

For an app that holds the customer's keys. The `wallets` property is a list,
so it is set from script rather than as an attribute:

```js
const el = document.createElement('btcdirect-journey');
el.wallets = [
  { currency: 'BTC', address: 'bc1q…', label: 'Savings', id: 'acc-1' },
  { currency: 'XRP', address: 'r…', memo: '123456' },
];
el.setAttribute('api-key', 'API_KEY');
el.setAttribute('subjects', 'offer_fiat_to_coin,onboarding');
document.querySelector('#checkout').append(el);
```

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `currency` | string | required | The coin the wallet holds, as a ticker or a CAIP-19 id. |
| `address` | string | required | The wallet address. |
| `memo` | string | optional | Its memo or destination tag, on the networks that need one. |
| `label` | string | optional | The name the customer sees in the address picker. |
| `id` | string | optional | Your own id for the wallet. Never sent to us; it is handed back on the sell events, so you know which account to sign with. |

When you supply wallets, they replace the customer's saved addresses, and the
coin picker only offers the networks they cover.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `source-wallet` | string | optional | On a sell, the address out of wallets the customer sells from. |
| `crypto-deposit` | string | optional | On a sell, who sends the crypto. manual (the default) shows the customer our address to pay to. wallet waits for your app to send it, see Methods. |
| `wallet-confirmation-required` | boolean | optional | true makes the widget ask your app to confirm the payout address on the customer's device before the order is placed. See Methods. |

## What the host sets

These exist for a page that already knows something the widget would otherwise
have to ask for. You are unlikely to need them.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | optional | Realtime WebSocket endpoint. Defaults to ours; override it to point at another environment. |
| `api-base-url` | string | optional | REST base, derived from url when omitted. |
| `offer-id` | string | optional | Resumes an offer created server-side. Authenticates by the offer itself, so no api-key is needed alongside it. |
| `upgrade` | string | optional | Enters the account tier-upgrade flow directly. |

> **Some attributes are ours, not yours**
>
> `bearer`, `payment-token`, `compliance-token`, `hosted-payment-in-place` and
> `translations-base-url` exist for our own hosted pages, which mount the same
> element under credentials a partner never holds. They are listed here so the set
> is complete, not as configuration to reach for.
