Initialise Deko Wallet

What You'll Need | Initialise Deko Wallet | Show Finance Offers | Start Checkout | Complete Checkout | Confirm Order

4. Initialise Deko Wallet

Deko Wallet is a plugin to enable you to easily embed finance options in any page of your website as well as at checkout, where it can facilitate a finance-based purchase. In order to enable the plugin on a webpage, you must first initialise it.

The Deko Wallet must be initialised before being used for any of the following steps:

  1. Promote Finance (optional*) outside Checkout
  2. Show All Finance Offers (optional*) outside Checkout
  3. Start Checkout (commences by showing Finance Offers)
*subject to FCA permissions - please consult your account manager

To initialise the Deko Wallet please follow these steps, using the corresponding Access Token you obtained for your Merchant:

Obtain a JWT

Call the init endpoint in a machine to machine call to receive a JSON Web Token (JWT):

curl -X 'POST' \
  'https://dummy-api.staging.host.com/init' \
  -H 'accept: application/hal+json' \
  -H 'Authorization: Bearer xeyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Imp6SXZmaU1HNkJqVEpUWGxkRlVwZSJ9.eyJpc3MiOiJodHRwczovL2Rla29wYXktbWVyY2hhbnQtZGV2LmV1LmF1dGgwLmNvbS8iLCJzdWIiOiJ2TDBac0VOOWo1TlQ0VlAzY0ZLQnAxakY5NHNtNUM4dkBjbGllbnRzIiwiYXVkIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgxL2FwaS9jaGVja291dCIsImlhdCI6MTYxNjU5MTU4NywiZXhwIjoxNjE2Njc3OTg3LCJhenAiOiJ2TDBac0VOOWo1TlQ0VlAzY0ZLQnAxakY5NHNtNUM4diIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.F-dzPkJVF0ub2kGiWn1As5PSMnIiqAriOhyux47t7lbNk0tD9Wu655JGHmjuAqqQ3uWyqXx9-feuYjv61xufgBfxH17OkIqBB9lVJzEONoVqF5uIzsnaTD2z0FTzcvOuH8RXzA-_q7vFZwvbboE9iZCFd-JN8vI_1jjWDUpdKFWzGk0-AmID9F7qgNnyC2WEb6DK4Ky5VttXPXcGfnIGD2ybOgkg1dOlBhzabJBT9jU_UQuBoKjqQoNqVm1ovhFJzzSWMsHqDIDOb7r-0zXRB33ka4_oKoVnVrvxL2hGblgC-2Jg6gfB7uuVPdbM5FIBFx8Cbt4T83KxXbpJy5hQbg' \
  -d ''

The POST request returns the init_token.

Initialise the Deko Wallet

Initialise the Deko Wallet via the _Window _object. This should be done in a closure to protect the scope. The function you pass to the dekoWallet.init method must make a request to your server which in turn would request the init token from the Deko Public API. The return type of your function should be a Promise that resolves to the init token retrieved by your server. See below.

const yourFunction = () => { 
    return Promise.resolve(myInitToken);
  }
  const wallet = window.dekoWallet.init(yourFunction);

In this example, the wallet variable is an instance of the dekoWallet Javascript API. This API enables you to checkout and display or hide the wallet UI.

Alternatively you may choose to initialize the wallet in a hidden state so the tile will not pop up immediately after initialization.

const yourFunction = () => { 
return Promise.resolve(myInitToken);
}
const wallet = window.dekoWallet.init(yourFunction, {isVisible: false});

Promote Finance

Once the Deko Wallet has been initialised you have the option to show or hide a floating tile on each webpage. This allows you to promote the availability of finance to customers browsing your site.

Promoting credit is a regulated activity in the UK and you can only initialise the Deko Wallet and show the tile outside checkout if you have relevant FCA permissions. Read more about Financial Promotion requirements.

You can use the wallet Javascript object to hide or show the tile. Customers clicking on the tile outside of checkout will open the Deko Wallet and be able to see available Finance Offers based on a standard purchase amount.

wallet.hide();
wallet.show();
🚧

Regulated Activity

The presentation of Finance Offers on your platform constitutes Financial Promotion which is a regulated activity known as Credit Broking. Deko can advise you of your options to either obtain a suitable regulatory permission or to operate without this, subject to not displaying the tile and following strict guidance on how you introduce finance at checkout. Read more about Financial Promotion requirements.


Footer