v3

Transactions and recurring buys

The two elements beside the trading flow — the customer's order history and their recurring buys.

Two things a customer comes back for have no journey to walk through, so they are elements of their own rather than subjects of <btcdirect-journey>. Both take the same credentials.

Order history

<btcdirect-transactions> lists the customer's orders, newest first, with each order's status and details.

<btcdirect-transactions
  api-key="API_KEY"
  user-identifier="CUSTOMER_ID"
  locale="en"
></btcdirect-transactions>

Without a user-identifier the customer signs in inside the element first.

Recurring buys

<btcdirect-savings> lets the customer set up, view and stop recurring buys: a standing transfer from their bank that buys the same coin every time it arrives.

<btcdirect-savings api-key="API_KEY" locale="en"></btcdirect-savings>

It opens on an introduction, so a guest can read what a recurring buy is before signing in. To offer your own wallets as payout addresses, set the same wallets property as on the trading element (see Attributes):

document.querySelector('btcdirect-savings').wallets = [
  { currency: 'BTC', address: 'bc1q…', label: 'Savings' },
];

A wallet for a coin that lives on more than one network is left out, since the plan form picks an address per network and your wallet names only the coin.

Attributes

Both elements read these:

api-keyrequired

string

Your api-key.

user-identifieroptional

string

Your own id for a customer you have already registered with us.

localeoptional

string

Language for the widget’s own copy: nl, en, de, fr or es.

themeoptional

string

dark for the dark theme. Anything else is light.

api-base-urloptional

string

REST base. Defaults to ours; override it to point at another environment.