E-Commerce & M-Commerce
5. E-Commerce 
Kenz'up mobile applications integration with partners to allow Kenz'up customers to earn and burn/pay on the partner's website or mobile application. In all cases the backend integration is similar :
- The partner backend sends a POST request to /earn-request or /payment-request containing sale information (cf 3.2 & 3.3)
- The partner backend recieves a polling url that it checks periodically for state changes on the request (we recommend 0.5 seconds)
- The polling url returns  {"status":"pending"}untill the transaction is validated
- The polling url returns  {"status":"claimed"}when the customer has earned the points (paid out of the app) or
- The polling url returns {"status":"approved"}when an the customer has paid the requested amount
5.1 Mobile Website or Mobile Application
Kenz'up mobile application allow another mobile application to invoke it trough Deeplinks. Mobile web browsers are also capable of opening the application trough javascript.
Both /earn-request and /payment-request endpoints return a 'deeplink' field similar to :
kenzup://Sale/269cac45-0684-4338-8831-9d3f7324106d
The partner mobile website or application can open the Kenz'up app trough this Deeplink by adding the following parameters:
- 
successRedirect : an Url for the Kenz'up to redirect to after a successful transaction 
- 
failureRedirect : an Url for the Kenz'up to redirect to after a failed transaction 
Both parameters can be either an https website page or a deeplink back to the partner mobile application.
Both parameter need to be urlencoded.
Both parameters can be the same.
Examples
Redirecting to http://partner.com/order/12345 on success and on failure
kenzup://Sale/269cac45-0684-4338-8831-9d3f7324106d?successRedirect=https%3A%2F%2Fpartner.com%2Forder%2F12345&failureRedirect=https%3A%2F%2Fpartner.com%2Forder%2F12345
Redirecting to partnerapp://PaymentOK/12345 on success and to partnerapp://PaymentFail/12345 on failure
kenzup://Sale/269cac45-0684-4338-8831-9d3f7324106d?successRedirect=partnerapp%3A%2F%2FPaymentOK%2F12345&failureRedirect=partnerapp%3A%2F%2FPaymentFail%2F12345
⚠️
Please note that only when the backend recieves an APROVED response from the kenz'up backend for a transaction is a payment confirmed.
Please note any other application or website could send a user to the successRedirect url. Accessing the url should not be considered as a confirmation of a successfull payment.
The purpose of differentiating successRedirect from failureRedirect is to allow flexibility for the partner to redirect to different pages/screens. It does not guarantee the success or failure of the payment.