Attributes
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
api-keyrequired
string
Your api-key. Read by the browser, which is what a widget key is for: it identifies your integration, it does not authorise spending.
subjectsrequired
string
Comma-separated journeys to mount, e.g. offer_fiat_to_coin,onboarding. See Journeys.
localeoptional
string
Language for the widget’s own copy: nl, en, de, fr or es. Anything we do not ship falls back to English.
themeoptional
string
dark for the dark theme. Anything else is light.
user-identifieroptional
string
Your own id for a customer you have already registered with us. Mounts the widget as that person.
anon-session-idoptional
string
A guest key for a customer who has not signed in yet, so their in-progress trade survives a reload.
acting-asoptional
string
business to trade on behalf of a company the customer represents. Anything else is the person themselves.
business-idoptional
string
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.
currencyoptional
string
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-currencyoptional
string
The fiat currency, ISO 4217, e.g. EUR.
fiat-amountoptional
string
The amount in fiat, as a decimal string. Set this or crypto-amount, not both.
crypto-amountoptional
string
The amount in crypto, as a decimal string.
payment-methodoptional
string
The payment method to preselect. Only applies when the customer can use it.
wallet-addressoptional
string
Where a buy pays out to.
wallet-memooptional
string
The memo or destination tag for that address, on the networks that need one.
fixed-currencyoptional
boolean
true locks the coin and the fiat currency, so the customer cannot change them.
fixed-amountoptional
boolean
true locks the amount.
fixed-payment-methodoptional
boolean
true locks the payment method.
hide-wallet-addressoptional
boolean
true hides the wallet address field, for a page that supplies the address itself.
direct-confirmoptional
boolean
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.
<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
partner-order-identifieroptional
string
Your own reference for this trade. It is stored with the order and comes back on its webhooks, so your systems can reconcile.
return-urloptional
string
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.
closableoptional
boolean
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:
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);currencyrequired
string
The coin the wallet holds, as a ticker or a CAIP-19 id.
addressrequired
string
The wallet address.
memooptional
string
Its memo or destination tag, on the networks that need one.
labeloptional
string
The name the customer sees in the address picker.
idoptional
string
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.
source-walletoptional
string
On a sell, the address out of wallets the customer sells from.
crypto-depositoptional
string
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-requiredoptional
boolean
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.
urloptional
string
Realtime WebSocket endpoint. Defaults to ours; override it to point at another environment.
api-base-urloptional
string
REST base, derived from url when omitted.
offer-idoptional
string
Resumes an offer created server-side. Authenticates by the offer itself, so no api-key is needed alongside it.
upgradeoptional
string
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.