Basket synchronization initiated at the Merchant store's website:
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 basket in InPost Pay) "– the widget embedded on the product card
"Kup z InPost Pay (Buy with InPost Pay)" -the 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 linked (basket_linked=true) or the basket is not linked (basket_linked=false), and the browser is trusted (browser_trusted=true).
The Merchant's backend refreshes the store's website together with the updated Widget, to which the message is transferred:
The Widget adds the product to the basket in the Merchant's store (iziAddToCart).
Upon receiving the request put/v1/izi/basket/{basket_id}, InPost Pay updates the existing basket when basket_linked=true, or binds it to the phone number assigned to the trusted browser when basket_linked=false. Then, it notifies the Merchant's backend of the successful operation (response 200).
The Merchant's backend calls inpost-update-count that authorizes updating the number of products on the button.
The widget presents the updated number of products in the basket.
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.
Link to calling the method: PUT/v1/izi/basket/{basket_id} as an example
Basket synchronization initiated by InPost Pay:
In the InPost Pay app, the Customer will be able to update the basket in the scope of:
changing the quantity of the products in the basket (quantity_event_data)
adding/removing a promotion code (promo_codes_event_data)
adding a suggested product to the basket (related_products_event_data)
In the event when the user performs one of the aforementioned modifications in the basket, InPost Pay, using the method POST/v1/izi/basket/{basket_id}/event, will notify the Merchant in the form of an event of the specific operation.
The Merchant's backend recalculates the basket.
Upon receiving the event which updates the customer's basket, the Merchant's backend sends the updated basket in the response POST/v1/izi/basket/{basket_id}/event.
The Merchant's backend calls inpost-update-count that authorizes updating the number of products on the button.
The Merchant's backend notifies the store's frontend, which shows the updated basket to the customer.
The widget presents:
The InPost Pay app presents the updated basket.
Link to calling the method: POST/v1/izi/basket/{basket_is}/event
Order synchronization initiated on the Merchant's store website:
When the Merchant has:
changed the status of the order, or the description of the order status presented in the store
assigned a reference number to the shipment they should call the method POST/v1/izi/order/{order_id}/event to the InPost Pay app in order to update the order's data.
Upon receiving the request POST/v1/izi/order/{order_id}/event, InPost Pay updates the order, and returns the confirmation of the successful operation (response 200).
Link to calling the method: POST/v1/izi/order/{order_id/event as an example
Order synchronization initiated by InPost Pay:
If the customer has:
paid for the order, or
rejected the order before the payment InPost notifies the Merchant of the occurrence of the event with the use of the method from POST/v1/izi/order/{order_id}/event.
Upon receiving the request POST/v1/izi/order/{order_id}/event, the Merchant returns the confirmation of receiving the information (response 200).
Link to calling the method: POST/v1/izi/order/{order_id}/event as an example
Diagram UC.04 Synchronization of the basket and the order