Confirm Payment
What You'll Need | Initialise Deko Wallet | Show Finance Offers | Start Checkout | Complete Checkout | Confirm Payment
8. Confirm Payment
We can notify your platform privately when a purchase starts or has been completed - for example providing status updates for a finance order in your platform. This is done using a callback to your pre-configured endpoint or to the callbackUri
which you set dynamically for each transaction when you start checkout by calling the /verify-basket
end point with this field.

These callbacks alert your server to any updates to an applicable finance purchase, which for security you can also then validate via the transaction endpoint as part of an authenticated API request. You can use your own transaction identifier (set as reference
in the original payload for /verify-basket
) to match and validate that it is the corresponding finance application.
{
"id": "87463d12-9831-3267-a108-d4613efa370c", // the deko unique identifier for the purchase
"status": "SUCCESSFUL", // the status of the purchase
"statusLastUpdated": "1642167702440", //unix timestamp
"reference": "e917ecf1-00ed-46a9-8867-cbaf53dfef1d", // your platform unique reference
"productType": "multi_lender", // the name of the deko product
"receipt": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im8yTWdPNFJic1B5WiJ9.eyJzY29wZSI6ImFwcGxpY2F0aW9uOmNyZWF0ZSIsImh0dHBzOi8vYXBpLnN0YWdpbmcuazhzLmRla29wYXkub3JnL2FwcGxpY2F0aW9uIjp7InN0YXR1cyI6InN1Y2Nlc3MiLCJwcm9kdWN0IjoicmV2b2x2aW5nX2NyZWRpdCIsImxpbmtzIjpbeyJocmVmIjoiaHR0cHM6Ly9hcGkuc3RhZ2luZy5rOHMuZGVrb3BheS5vcmcvY2hlY2tvdXQvcmV2b2x2aW5nX2NyZWRpdC84NzQ2M2QxMi05ODMxLTMyNjctYTEwOC1kNDYxM2VmYTM3MGMiLCJyZWwiOiJzZWxmIn1dLCJsYXN0X3VwZGF0ZWQiOiIxNjQyMTY3NzAyNDQwIiwiYXBwbGljYXRpb25faWQiOiI4NzQ2M2QxMi05ODMxLTMyNjctYTEwOC1kNDYxM2VmYTM3MGMiLCJ0cmFuc2FjdGlvbl9pZCI6ImU5MTdlY2YxLTAwZWQtNDZhOS04ODY3LWNiYWY1M2RmZWYxZCJ9LCJpYXQiOjE2NDIxNjc3MDMsImV4cCI6MTY0Mzk2NzcwMywiYXVkIjoiaHR0cHM6Ly9hcGkuc3RhZ2luZy5rOHMuZGVrb3BheS5vcmciLCJpc3MiOiJodHRwczovL2FwaS5zdGFnaW5nLms4cy5kZWtvcGF5Lm9yZy8iLCJzdWIiOiJiMDE1MTk4My0xZGRiLTRkODktOGNjOC0xN2Y3MDhkYTU2MDYiLCJqdGkiOiJiZjAxMWNjOC1mMjI2LTQzNzYtOWQ1NS1lYzk0NjE5ODE4YTEifQ.ApZJXjmQKD443PEXNXpSHcoAt5bpx1DY7SzkETgGzii7B401_PvrwnvILFg0Dt0o4-iSYVprB6_r1Pnvkw7r656pK8mK0AClMacxWF9kzd0jq4Sj6bOXqKznS6GiDMfBR92hoDtEibjOvu4iwwjyf2H1zFyQgB6iiCDmj1Kud7XOc5HgpQRYa2Y0H16PnkhepFGXY-SFefiWnNbJDUcdoUD0zuAhkM2mgLOFOaJylFMh63r-oGBkEDxD7YJ9Cj8RPiwL6Nqz6QfJsPaXHZqbceNFfpLdzC9DJjDRSVDrkPaALvWlLWM1XBGUPLV_nROqJx7mO2d89PLHnxXI45ZDObx4_VMVbC2uS2i2C_0dZu1iPyPY68_YSVAvnMzPeDyYqKx7aqGjfqeKd75JXzgsEP2h12MolO6AQ1yMUqi02HdAeYIrlVU8oHcwjFmwlvRZKOJ9knIDNq9d8C3kDqtwQfimYPLzLGsegcOpq_1nF5XQ2EOiPiX2Ww1hhtuXw51VQqEQFOVcuCoLkmQn3Bnas_LG6igshnjLhZYXdKuHhzQEh5NGG_zCfMdSKmTIq0jiVc1BKgn3G2DXSLanscwg6AXHrqudud3rFDqEsCtyuojDH23P7UPvlSqg2Puo9HmGJIFTbb_k4ilHveP5eurkqvegqSNSpJZ5mVtgXS2hQoY"
}
Purchase Status
You can use the status value to update your platform and complete any associated processes:
Status | Notes |
---|---|
PENDING | a finance-based checkout has started and is now awaiting a final purchase outcome |
SUCCESSFUL | a finance-based checkout has been completed and the purchase has been successful |
FAILED | a finance-based checkout did not complete and the purchase was not successful |
A purchase using finance can result in a status of FAILED
for a number of different reasons, including:
- the finance application was declined by the lender
- the finance application was abandoned or cancelled by the customer
- the finance application was incomplete and inactive for a defined lender time threshold
Health Warning!Deko will send these notifications asynchronously and you may receive them after a delay and on some occasions you might receive duplicate updates. It is important that you cross reference any new status against your records and update to a final state (as applicable), to avoid future errors.
Referrals
Unlike other forms of digital payment, finance purchases (as with all applications for credit) are sometimes subject to referral by the lender for manual review and underwriting. For many lenders, referrals can be completed within 1 hour but can sometimes take up to 24 hours.
We'll maintain a purchase in PENDING
status until we receive a final decision from the lender, at which point we'll send you a callback to reflect the updated status. Your platform will need to be able to advise the customer of this delay and to handle offline.
Should it not be possible to maintain pending purchases on your platform.
The receipt received from a successful checkout (see step 7, Complete Checkout) is a JWT detailing the order and proving that it was sent from Deko.
{
"scope": "application:create",
"https://api.staging.k8s.dekopay.org/application": {
"status": "success", // the status of the application, not to be confused with the order
"product": "instalment", // the name of the deko product
"links": [
{
"href": "https://api.staging.k8s.dekopay.org/checkout/revolving_credit/87463d12-9831-3267-a108-d4613efa370c",
"rel": "self"
}
],
"last_updated": "1642167702440",
"application_id": "87463d12-9831-3267-a108-d4613efa370c", // the deko unique identifier for the order
"transaction_id": "e917ecf1-00ed-46a9-8867-cbaf53dfef1d", // the merchant unique reference
},
"iat": 1642167703,
"exp": 1643967703,
"aud": "https://api.staging.k8s.dekopay.org",
"iss": "https://api.staging.k8s.dekopay.org/",
"sub": "b0151983-1ddb-4d89-8cc8-17f708da5606",
"jti": "bf011cc8-f226-4376-9d55-ec94619818a1"
}
You can also use the receipt information to confirm the order status, by invoking the transaction endpoint detailed below.
curl -X 'GET' \
'https://dummy-api.staging.host.com/transaction/d290f1ee-6c54-4b01-90e6-d701748f0851' \
-H 'accept: application/hal+json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Imp6SXZmaU1HNkJqVEpUWGxkRlVwZSJ9.eyJpc3MiOiJodHRwczovL2Rla29wYXktbWVyY2hhbnQtZGV2LmV1LmF1dGgwLmNvbS8iLCJzdWIiOiJ2TDBac0VOOWo1TlQ0VlAzY0ZLQnAxakY5NHNtNUM4dkBjbGllbnRzIiwiYXVkIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgxL2FwaS9jaGVja291dCIsImlhdCI6MTYxNjU5MTU4NywiZXhwIjoxNjE2Njc3OTg3LCJhenAiOiJ2TDBac0VOOWo1TlQ0VlAzY0ZLQnAxakY5NHNtNUM4diIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.F-dzPkJVF0ub2kGiWn1As5PSMnIiqAriOhyux47t7lbNk0tD9Wu655JGHmjuAqqQ3uWyqXx9-feuYjv61xufgBfxH17OkIqBB9lVJzEONoVqF5uIzsnaTD2z0FTzcvOuH8RXzA-_q7vFZwvbboE9iZCFd-JN8vI_1jjWDUpdKFWzGk0-AmID9F7qgNnyC2WEb6DK4Ky5VttXPXcGfnIGD2ybOgkg1dOlBhzabJBT9jU_UQuBoKjqQoNqVm1ovhFJzzSWMsHqDIDOb7r-0zXRB33ka4_oKoVnVrvxL2hGblgC-2Jg6gfB7uuVPdbM5FIBFx8Cbt4T83KxXbpJy5hQbg'
Updated 8 months ago