Binding a basket with InPost Pay using phone number
The Client goes to the Merchant's website.
The Merchant builds the store's website with an embedded widget with the message:
"Utwórz koszyk z InPost Pay (Create a basket with InPost Pay)" -widget embedded on the product card
"Kup z InPost Pay (Buy with InPost Pay)" -widget embedded in the basket
The customer presses the widget "Utwórz koszyk z InPost Pay (Create a basket with InPost Pay)", or "Kup z InPost Pay (Buy with InPost Pay)".
The Widget verifies in the Merchant's backend, whether or not the chosen product is available for adding to the basket (iziCanBeBound).
At the first method called by the Widget, the Merchant's backend calls the method to InPost Pay to verify whether or not the customer's basket is bound to InPost Pay, and whether or not the browser the customer currently uses is among the trusted ones. The verification takes place through the request GET/v1/izi/basket/{basket_id}/binding.
InPost Pay returns the information that the basket is not linked (basket_linked=false), and the browser is not trusted (browser_trusted=false).
The Widget adds the product to the basket in the Merchant's store (iziAddToCart).
The Widget presents the default screen for binding the basket using a telephone number.
The customer defines the phone number and presses "Połącz (connect)".
The Widget calls the method iziGetPayData, which downloads the data necessary to pair baskets and contains the method iziGetBrowserData which returns the browser data to the Merchant's backend, which, using the method POST/v1/izi/basket/{basket_id}/binding, transfers the phone number to InPost Pay. InPost Pay verifies the security/spam rules of the binding for the phone number. In the case of:
positive verification, it sends the response (202) to the Merchant, and sends the notifications (push) to the client's device.
negative verification, the basket binding process is finished (InPost Pay returns an error code to the Merchant's backend).
The widget presents the message
With the push notification, the customer starts the InPost app:
approves the binding of the basket
signs into InPost Pay and approves the binding of the basket.
InPost Pay binds the basket (the basket's id sent by the Merchant) with the phone number and notiifies the Merchant of binding the basket using the POST/v1/izi/basket/{basket_id}/confirmation method.
InPost Pay binds the basket (the basket's id assigned by the Merchant) to the phone number.
The Merchant's backend transfers the information about binding the basket to the Widget (response iziGetIsBound)
The Widget presents the customer with the information on the Widget "Produkty w koszyku InPost Pay (Products in InPost Pay basket)", and saves
browser_id
in the browser cookies.The InPost Pay app presents the basket bound to the customer.
After obtaining the information that the basket is now linked, the Widget starts observing the Merchant's backend (with the use of iziGetOrderComplete and one of the looping or websocket methods), to see if the order was completed for the basket. Upon receiving the information of the completion, the widget notifies the customer showing the screen with thanks for the finalization of the order.
Diagram UC.03 Binding a basket with InPost Pay using a phone number