Flows
The capabilities mentioned on this page must be registered with the EPOS Capabilities API prior to initiating an Order and Pay flow, learn more here.
- Order and Pay Flow
- Pay-only flow
The following diagram demonstrates how the Order and Pay product will interact with Dojo and the POS system for creating orders and completing payments:
Step-by-step: Order and Pay
Step 1: Customer creates order to Dojo
The first stage of the Order and Pay flow is triggered when a customer, having accessed a list of venue products using the Dojo Order and Pay interface, creates an order by adding one or more items to the basket and advancing to the payment screen.
Step 2: Dojo creates a Payment Intent and authorises the payment
Once the order has been initiated via the Order and Pay interface, Dojo will pre-authorise the payment by creating a Payment Intent and initiating a checkout flow for the customer. This payment is to be captured once the POS has confirmed the order. This also generates a paymentIntentId
which will be used to track the payment details, as well as an externalId
which represents Dojo's orderId and will need to be referenced on further updates.
Step 3: Dojo creates an order on the POS
POST REST /v1/orders
Main page: Orders
The next step in is for Dojo to create the customer order within the POS, using the CreateOrder
capability. The request will contain fields such as item data, type of order and payment details, including the payment intent. It may also contain any additional modifiers or discounts, for example, if specified.
The POS should respond to Dojo with a 200 response to confirm that this has been received.
Step 4: Dojo captures the payment and informs the POS of the payment update
POST REST /v1/events
Main page: Dojo Events
Dojo will now capture the pre-authorised payment. Once captured, Dojo will use the HandleEvent
capability to inform the POS that an update has been made to the payment.
Step 5: POS checks the Payment Intent
GET GET /paymentIntentId/{paymentIntentId}
Main page: Check payment intent status
As the HandleEvent
capability does not confirm payment information, the POS will now need to check the payment intent by using the Dojo API's Retrieve Payment Intent call. The POS can use this call to retrieve the final result of the transaction along with any additional payment and customer information captured. The Payment Intent will also include an externalId
matching the Order ID stored by the POS.
Step 6: POS records the payment and updates the order status
POST REST /epos/events
Main page: POS Events
Once the payment has been recorded and the POS has updated its internal order ID, it should make a POST using the Dojo API's events endpoint with an eventType of OrderUpdated
.
Step 7: Dojo checks order status and updates customer
Main page: Orders
Once informed of the order update, Dojo will check the status of the order by calling the Orders capability with a GET request. After confirming the order status, Dojo will inform the customer of the outcome through the Order and Pay interface.
The following diagram demonstrates how the Order and Pay product will interact with Dojo and the POS system to exclusively complete payments:
Step-by-step: Pay-only
Step 1: Customer retrieves orders
POST REST /v1/orders
Main page: Orders
The first stage of the pay-only flow is triggered when a customer attempts to retrieve open orders using the Order and Pay interface. Dojo will request these from the POS using the SearchOrders capability, refining the request by certain filters such as table ID if necessary. Once Dojo has received the orders requested, these will be displayed to the customer for selection.
Step 2: Dojo creates a Payment Intent and authorises the payment
POST REST /v1/events
Main page: Dojo Events
Once the correct order has been selected by the customer, Dojo will create a Payment Intent and initiate the checkout flow for the customer to capture payment.
This also generates a paymentIntentId
which will be used to track the payment details. This is provided to the POS by Dojo using the HandleEvents:payment_intent.created
capability, which will contain this ID. This ID will be used to provide the POS with further payment updates.
Step 3: Dojo captures the payment and informs the POS of the payment update
POST REST /v1/events
Main page: Dojo Events
Once the customer checkout flow is completed and the payment captured, Dojo will use the HandleEvent:payment_intent.status_updated
capability to inform the POS that an update has been made to the payment.
Step 4: POS checks the Payment Intent
GET GET /paymentIntentId/{paymentIntentId}
Main page: Check payment intent status
As the HandleEvent
capability does not confirm payment information, the POS will now need to check the payment intent by using the Dojo API's Retrieve Payment Intent call. The POS can use this call to retrieve the final result of the transaction along with any additional payment and customer information captured. The Payment Intent will also include an externalId
matching the Order ID stored by the POS.
Step 5: POS records the payment and updates the order status
POST REST /epos/events
Main page: POS Events
Once the payment has been recorded and the POS has updated its internal order ID, it should make a POST using the Dojo API's events endpoint with an eventType of OrderUpdated
.
Step 6: Dojo checks order status and updates customer
Main page: Orders
Once informed of the order update, Dojo will check the status of the order by calling the Orders capability with a GET request. After confirming the order status, Dojo will inform the customer of the outcome through the Order and Pay interface.