v3

Journeys

What to put in `subjects`, and what the customer sees for each.

subjects is the one attribute that decides what the widget does. It takes a comma-separated list, and the widget renders whichever step of those journeys the customer is currently on.

Buying and selling

offer_fiat_to_coinBuy
The customer pays fiat and receives crypto. They enter the amount, pick a payment method and a destination, and pay.
offer_coin_to_fiatSell
The customer sends crypto and receives fiat. Same shape, with a payout account instead of a wallet address.

There is no direction attribute. Which of the two you mount is the direction, and a page offering both mounts one at a time — a buy/sell toggle in your own UI swapping the value.

Pair either with onboarding:

<btcdirect-journey
  api-key="YOUR_API_KEY"
  subjects="offer_fiat_to_coin,onboarding"
  locale="en">
</btcdirect-journey>

Onboarding covers registration and verification. Mounted alongside the trade, a customer who needs to verify does it in place and continues — rather than hitting a wall the widget cannot get them past.

Onboarding on its own

subjects="onboarding" mounts verification with no trade attached, for a page whose only job is getting a customer verified before they reach anything else. It dispatches btcdirect:onboarding-complete when they are through.

Wallet addresses on a buy

A buy has to pay out somewhere. The customer can enter an address in the widget, or you can pre-bind one — and some chains identify the recipient with a memo or destination tag alongside the address, where a transfer to the right address without the tag is not credited.

The widget handles the entry and validation itself, including which chains need a tag. If you are collecting addresses on your own screens instead, validate them through the validation endpoint rather than with a pattern of your own, and read memos and destination tags first.

Resuming an order

Once the customer confirms, the trade stops being an offer and becomes an order. The widget follows it automatically — but if your page remounts the element, the subscription is gone and you have to say which order to pick back up:

order_fiat_to_coin:{orderId}Buy
Resumes that order where it left off.
order_coin_to_fiat:{orderId}Sell
The same, for a sell.

The id is the one btcdirect:order-created handed you. This is why that event is worth listening to even if you get the same information on a webhook: the webhook arrives on your server, and it is your page that needs to restore the element.