Start Checkout
What You'll Need | Initialise Deko Wallet | Show Finance Offers | Start Checkout | Complete Checkout | Confirm Payment
6. Start Checkout
If the Deko Wallet has been initialised, regardless of whether you have chosen to show finance offers natively in your platform's experience, you will be able to commence a checkout with finance, by providing Deko details of the proposed purchase. This is done securely via API in order to obtain an additional authenticated JSON Web Token (JWT).

Depending how your platform presents the purchasing experience, you may wish to initiate finance checkout at a result of a button press, form submission or other action. Traditional retailer ecommerce platforms often use a single HTML form at checkout which changes the form action and submit button description based on the selected payment option.
You can view further details of the API schema in the API Reference
Submit Purchase
Checkout with finance in your platform can be initiated by submitting details of the customer and their proposed purchase to Deko. To eliminate the risk of customer or purchase data being intercepted or tampered with, this is done privately via API to a verify-basket endpoint which returns an additional JWT access token.
This token validates for the Deko Wallet Javascript library that the intended purchase is valid and authenticated, enabling the Wallet to launch the applicable finance application and purchase journey within your platform. The verify-basket
request can include the following objects as detailed in the API Reference:
customer
- personal details of the customer to perform the finance applicationbasket
- total value of the purchase and a breakdown of each individual line item*reference
- a unique reference from your platform to easily reconcile the purchasecallbackUri
- a script URL in your platform where Deko can provide status updates
Regulated ActivityIn addition to displaying Financial Promotions on your platform, if you submit
customer
data to Deko'sverify-basket
endpoint (which may be used by the lender to pre-fill their finance application) this also constitutes a regulated activity known as Credit Broking. In this case it is because your platform is facilitating the finance application.Please do not use this feature without applicable FCA permissions or consult your account manager for further guidance.
In response, you will receive an additional JWT.
curl -X 'POST' \
'https://dummy-api.staging.host.com/verify-basket' \
-H 'accept: application/hal+json' \
-H 'Authorization: Bearer xeyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Imp6SXZmaU1HNkJqVEpUWGxkRlVwZSJ9.eyJpc3MiOiJodHRwczovL2Rla29wYXktbWVyY2hhbnQtZGV2LmV1LmF1dGgwLmNvbS8iLCJzdWIiOiJ2TDBac0VOOWo1TlQ0VlAzY0ZLQnAxakY5NHNtNUM4dkBjbGllbnRzIiwiYXVkIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgxL2FwaS9jaGVja291dCIsImlhdCI6MTYxNjU5MTU4NywiZXhwIjoxNjE2Njc3OTg3LCJhenAiOiJ2TDBac0VOOWo1TlQ0VlAzY0ZLQnAxakY5NHNtNUM4diIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.F-dzPkJVF0ub2kGiWn1As5PSMnIiqAriOhyux47t7lbNk0tD9Wu655JGHmjuAqqQ3uWyqXx9-feuYjv61xufgBfxH17OkIqBB9lVJzEONoVqF5uIzsnaTD2z0FTzcvOuH8RXzA-_q7vFZwvbboE9iZCFd-JN8vI_1jjWDUpdKFWzGk0-AmID9F7qgNnyC2WEb6DK4Ky5VttXPXcGfnIGD2ybOgkg1dOlBhzabJBT9jU_UQuBoKjqQoNqVm1ovhFJzzSWMsHqDIDOb7r-0zXRB33ka4_oKoVnVrvxL2hGblgC-2Jg6gfB7uuVPdbM5FIBFx8Cbt4T83KxXbpJy5hQbg' \
-H 'Content-Type: application/json' \
-d '{
"customer": {
"billingAddress": {
"title": "Dr",
"firstName": "Jane",
"lastName": "Doe",
"middleName": "R.",
"address1": "Deko",
"address2": "15 Bishopsgate",
"town": "Cornhill",
"county": "London",
"postcode": "EC2N 3AR",
"country": "GB"
},
"shippingAddress": {
"title": "Dr",
"firstName": "Jane",
"lastName": "Doe",
"middleName": "R.",
"address1": "Deko",
"address2": "15 Bishopsgate",
"town": "Cornhill",
"county": "London",
"postcode": "EC2N 3AR",
"country": "GB"
},
"phone": "00447000123456",
"email": "[email protected]",
"birthDate": "2021-07-01",
"fulfilment": "HomeDelivery"
},
"basket": {
"currency": "GBP",
"total": 134523,
"items": [
{
"description": "A shiny gold watch",
"quantity": 1,
"price": 134523,
"type": "sku",
"imageUri": "https://your-platform.fake/product/image/uri.jpg",
"itemUri": "https://your-platform.fake/product1.html"
}
]
},
"products": [
"multi_lender"
],
"reference": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"callbackUri": "https://your-platform.fake/deko/callback"
}'
Including 'Fulfilment' informationSome lenders may require your platform to provide information about expected customer fulfilment. This can be included in the the customer object using the fulfilment field, which can have one of three values:
- HomeDelivery - Delivery to home address, shippingAddress is same as billingAddress
- AlternativeAddress - Delivery to an alternate address, shippingAddress different to billingAddress
- CollectInStore - Collection in store (applicable only to platforms being used for in store purchases)
Launch Finance
While browsing of finance offers in the Deko Wallet is possible anonymously outside checkout without any checkout invocation, for starting and completing a checkout purchase it is first necessary to obtain the additional JWT access token as above. You can then use wallet.checkout()
to trigger the transaction process.
The function you pass to the dekoWallet.checkout
method must make a request to your server which in turn should request that checkout access token from the Deko API. The return type of your function should be a Promise
that resolves to the JWT token retrieved by your server, similar to the init method example.
const yourCheckoutFunction = () => {
return Promise.resolve(myCheckoutToken);
}
// Note using the wallet instance created in the Initialise step above.
wallet.checkout(yourCheckoutFunction);
Previously we explained how Deko Wallet allows you to show and hide the promotional tile. You can also use the following Javascript commands to manually open and close the wallet both before and during a transaction:
wallet.close();
wallet.open();
Updated 8 months ago