Skip to main content

Checkout overview

The checkout process is one of the more involved and complicated operations in eCommerce and POS applications. The normal order of business is:

  • Create an order
  • Fulfil order requirements
  • Pay for the order
  • Place the order
  • Ship the order
  • Invoice the order

We are only talking about sales orders here. Requirements can and will differ for other order types (Purchase, Wishlist)

The creation of an order is covered by the "shopping cart" state of the order. Products are added, modified or removed as needed.

Depending on the products in the order and the type of order lines (delivery, handover, etc) certain requirements may apply for the order. It may need a customer to be attached to it for a valid shipping address for instance. Certain products may need a scanned barcode or require custom details like an inscription. The possible option are not the focus of this documentation but it is important to know that the GetRequiredDataForOrder services drives these requirements. It will return requirements on 3 levels:

  • Customer
  • Order
  • OrderLine

The Customer requirements covers valid user details (address, date of birth, etc). The Order requirements cover the order as a whole where the OrderLine ones refer to a specific line (product, discount, etc).

The GetRequiredDataForOrder ranks requirements on levels which reflect the state an order goes through during a checkout:

  • PlaceOrder (1)
  • Payment (2)
  • Ship (4)
  • Invoice (8)

GetShoppingCart versus GetOrder#

These are the two main services involved with handling an order. The golden rule is:

  • use GetShoppingCart while building your order
  • use GetOrder during the checkout or for a more performant current order status

There is work being done on a single service to not have to make this distinction anymore. Watch this space.

Starting the checkout#

The first step to starting a checkout is calling PrepareOrderForCheckout each time the app starts the checkout. This will set the appropriate type on the order to initiate the requirements checking we will need during the checkout. Any required (tax) calculations will also be done at this point on the backend.

Placing an order#

Before an order can be placed basic requirements such as attaching a customer or configurable product choices need to have been made. Once all requirements with level 1 have been met the PlaceOrder service can be called. This will reserve or order the products in the order.

Shipping an order#

Once the products in the order can be handed over to the customer the ShipOrder service can and should be called. If during a checkout all the products are being delivered from a warehouse this would not be needed. This can be determined by checking if any of the order lines are of the shippable type. Simply calling ShipOrder with no specific lines in the payload will automatically ship all applicable lines. Should you wish to partially ship an order you will need to explicitly indicate which lines (products) you are shipping (handing over) to the customer.

Invoicing an order#

This process is entirely handled by the EVA backend. Once an order has been shipped it can be booked in the (linked) financial systems. Based on the customer details of the order the invoice will be made and sent as needed.

Checkout flow#

Depending on the type of order, payment method and partial shipping selections the checkout flow in a POS application will change. These are some of the checkout flows supported by EVA:

  • Ship sales order
  • Delivery sales order
  • Reservation sales order
  • Interbranch sales order
  • ReturnToSupplier (RMA) sales order

For the ship/deliver/reservation checkout the flow would look like this:

flowchart LR AddProductToOrder --> GetShoppingCart AddServiceProductToOrder --> GetShoppingCart AddBundleProductToOrder --> GetShoppingCart GetShoppingCart --> GetRequiredDataForOrder --> GetShoppingCart CancelOrderLine --> GetShoppingCart ModifyQuantityOrdered --> GetShoppingCart GetShoppingCart --> PrepareOrderForCheckout PrepareOrderForCheckout --> GetOrder GetOrder --> GetRequiredDataForOrder --> GetOrder GetOrder --> CreatePayment CreatePayment --> GetOrder GetOrder --> PlaceOrder PlaceOrder -. If shippable .-> ShipOrder