Confirm Order

Getting Started | Initialise Deko Wallet | Show Finance Info | Start Checkout | Complete Checkout | Confirm Order | Test Data

8. Confirm your Order

Deko sends notifications to Merchants when an order is created and when an order is updated. We will notify you on your pre-configured endpoint or the callbackUri (which you can also set dynamically for each basket by including it in the payload for /verify-basket).

These notifications alert your server to any updates, which you need to pull from the transaction endpoint. You can use your own transaction identifier (set as reference in the payload for /verify-basket) to match the order with the relevant finance application data.

{
  "id": "87463d12-9831-3267-a108-d4613efa370c", // the deko unique identifier for the order
  "status": "SUCCESSFUL", // the status of the order
  "statusLastUpdated": "1642167702440", //unix timestamp
  "reference": "e917ecf1-00ed-46a9-8867-cbaf53dfef1d", // the merchant unique reference
  "productType": "instalment", // the name of the deko product
  "receipt": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im8yTWdPNFJic1B5WiJ9.eyJzY29wZSI6ImFwcGxpY2F0aW9uOmNyZWF0ZSIsImh0dHBzOi8vYXBpLnN0YWdpbmcuazhzLmRla29wYXkub3JnL2FwcGxpY2F0aW9uIjp7InN0YXR1cyI6InN1Y2Nlc3MiLCJwcm9kdWN0IjoicmV2b2x2aW5nX2NyZWRpdCIsImxpbmtzIjpbeyJocmVmIjoiaHR0cHM6Ly9hcGkuc3RhZ2luZy5rOHMuZGVrb3BheS5vcmcvY2hlY2tvdXQvcmV2b2x2aW5nX2NyZWRpdC84NzQ2M2QxMi05ODMxLTMyNjctYTEwOC1kNDYxM2VmYTM3MGMiLCJyZWwiOiJzZWxmIn1dLCJsYXN0X3VwZGF0ZWQiOiIxNjQyMTY3NzAyNDQwIiwiYXBwbGljYXRpb25faWQiOiI4NzQ2M2QxMi05ODMxLTMyNjctYTEwOC1kNDYxM2VmYTM3MGMiLCJ0cmFuc2FjdGlvbl9pZCI6ImU5MTdlY2YxLTAwZWQtNDZhOS04ODY3LWNiYWY1M2RmZWYxZCJ9LCJpYXQiOjE2NDIxNjc3MDMsImV4cCI6MTY0Mzk2NzcwMywiYXVkIjoiaHR0cHM6Ly9hcGkuc3RhZ2luZy5rOHMuZGVrb3BheS5vcmciLCJpc3MiOiJodHRwczovL2FwaS5zdGFnaW5nLms4cy5kZWtvcGF5Lm9yZy8iLCJzdWIiOiJiMDE1MTk4My0xZGRiLTRkODktOGNjOC0xN2Y3MDhkYTU2MDYiLCJqdGkiOiJiZjAxMWNjOC1mMjI2LTQzNzYtOWQ1NS1lYzk0NjE5ODE4YTEifQ.ApZJXjmQKD443PEXNXpSHcoAt5bpx1DY7SzkETgGzii7B401_PvrwnvILFg0Dt0o4-iSYVprB6_r1Pnvkw7r656pK8mK0AClMacxWF9kzd0jq4Sj6bOXqKznS6GiDMfBR92hoDtEibjOvu4iwwjyf2H1zFyQgB6iiCDmj1Kud7XOc5HgpQRYa2Y0H16PnkhepFGXY-SFefiWnNbJDUcdoUD0zuAhkM2mgLOFOaJylFMh63r-oGBkEDxD7YJ9Cj8RPiwL6Nqz6QfJsPaXHZqbceNFfpLdzC9DJjDRSVDrkPaALvWlLWM1XBGUPLV_nROqJx7mO2d89PLHnxXI45ZDObx4_VMVbC2uS2i2C_0dZu1iPyPY68_YSVAvnMzPeDyYqKx7aqGjfqeKd75JXzgsEP2h12MolO6AQ1yMUqi02HdAeYIrlVU8oHcwjFmwlvRZKOJ9knIDNq9d8C3kDqtwQfimYPLzLGsegcOpq_1nF5XQ2EOiPiX2Ww1hhtuXw51VQqEQFOVcuCoLkmQn3Bnas_LG6igshnjLhZYXdKuHhzQEh5NGG_zCfMdSKmTIq0jiVc1BKgn3G2DXSLanscwg6AXHrqudud3rFDqEsCtyuojDH23P7UPvlSqg2Puo9HmGJIFTbb_k4ilHveP5eurkqvegqSNSpJZ5mVtgXS2hQoY"
}

You can use the status value to update your order management system as required:

PENDING - the order has been instantiated and is awaiting a final outcome
SUCCESSFUL - payment using finance has been successful and the goods/services can be released
FAILED - payment using finance has been unsuccessful and the order will not progress

PLEASE NOTE
Deko will send these notifications asynchronously and you may receive them after a delay and on some occasions you may receive duplicate update payloads. It is imperative that you cross reference the order against your records and update from Pending to either Failed or Successful, to avoid errors.

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'