Skip to main content

Hybris Order Flow

Overview

The following sequence diagram is the representation of the existing Hybris Order Flow, still in use at the time of writing this document (May 2023).

This is one of the key aspects of migration from Hybris to CommerceLayer. The order processing involved needs to be analysed and simplified to the defaults provided by CommerceLayer. There might be certain customisation required though, but we need to keep this to a minimum, when possible.

This has been created from the documentation available in Confluence, with the aim of performing that analysis and simplification.

Order Process Flow

The order process flow can be divided in three blocks

Order process - Creation of an order

Process running in Hybris, and interacting with Adyen (payments), Avalara (taxes) and NAV (ERP)

sequenceDiagram actor C as Customer participant H as Hybris participant A as Adyen participant AV as Avalara participant N as NAV autonumber C->>H: Place_Order H->>H: checkOrder Note right of H: Checks that the order is valid. H->>AV: avataxPost Note right of H: Post filing to Avalara tax is attempted.<br>This is then reconciled at Avalara when we post the invoice as a separate process. H->>H: isPayPalOrder Note right of H: Checks if order has been paid using PayPal.<br>If so, checks PayPal Authorisation is successful. H->>H: checkAuthorizeOrderPayment Note right of H: Checks if the Auth on the payment is successful, regardless of the payment type. H->>H: reserveAmount Note right of H: Order Status is updated to PAYMENT_AMOUNT_RESERVED. H->>H: checkTransactionReviewStatus Note right of H: Checks again if the payment has a successful Auth.<br>Also checks if there is a fraud flag on the order, based on the payment transaction entries. H->>H: isRccMembershipOrder Note right of H: Check if the order is for an RCC membership.<br>WILL THE RCC MEMBERSHIP USE CL's MEMBERSHIP FUNCTIONALITY? H->>H: sendOrderPlacedNotification Note right of H: Notification to the customer that their order has been placed.<br>This is handled a separate process called OrderConfirmationEmailProcess Will this use event into Bloomreach? activate H H->>H: isPaypalPayment Note right of H: Checks if order has been paid using PayPal, and triggers takePaypalPayment if so H->>H: takePaypalPayment Note right of H: Capture from Paypal deactivate H H->>H: splitOrder Note right of H: Create SINGLE consigment (no split really) H->>N: sendOrderToNav Note right of H: XML build to send to NAV's API activate N N-->>H: OK N-->>H: NOK deactivate N H->>H: startNavConsignmentProcesses Note right of H: Pauses this current process and invoques the next one,<br>nav-core-product-consignment-process H->>H: waitForWarehouseSubprocessEnd Note right of H: Order stays in this step during consigment process (next diagram)

Consigment process

Process running in Hybris after the order is created, and interacting with NAV (ERP).

Currently an Order contains a single Consigment (and this continue like this in the future, mainly related to our move to GXO as a single DC, confirmed with Logistics), which simplifies the process below, since a one order-to-many consigments would require consigment subprocessing and aligment with its parent Order status.

sequenceDiagram participant H as Hybris participant N as NAV autonumber H->>H: receiveNavAcceptedStatus Note right of H: Awaits consigment (1 consigment per order) accepted response from NAV activate N N-->>H: ACCEPTED N-->>H: ERROR Note left of N: Insufficient stock error deactivate N H->>H: decrementStock Note right of H: Decrements Hybris stock figures H->>H: waitForNavAllocated Note right of H: Awaits ACCEPTED/SHIPPED response from NAV<br>(ALLOCATED is not sent anymore) activate N N-->>H: ACCEPTED Note left of N: Includes courier, tracking ID, date and time? deactivate N rect rgb(248,206,204) H->>H: receiveNavAllocatedStatus Note right of H: Executes after the previous update is received. H->>H: waitForNavShipped Note right of H: Awaits SHIPPED response from NAV. end N->>H: SHIPPED H->>H: receiveNavShippedStatus Note right of H: Triggered when SHIPPED received from NAV on waitForNavAllocated step H->>H: subprocessNavEnd Note right of H: Sets the DONE status, ends this consigment processing.

Order Process - post-shipped processing

This is the process happening at Order level after the consigment has been set as SHIPPED by the previous process

sequenceDiagram participant H as Hybris participant A as Adyen participant AV as Avalara participant N as NAV autonumber H->>H: waitForWarehouseSubprocessEnd Note right of H: This was the status of the order on the first diagram<br> before running the consigment process H->>H: isProcessCompleted Note right of H: This checks if "Done" attribute on the previous consignment process is TRUE<br>REQUIRED? H->>H: isCancelOrder Note right of H: Checks if order is CANCELLING.<br>REQUIRED? alt takePaymentResponses, retrieved with a cronjob (no direct request) H->>A: takePayment Note right of H: If not a paypal order, send the capture request to adyen H->>H: waitForAdyenCaptureNotification A-->>H: OK A-->>H: NOK Note left of A: Send a email alert to disputes@rapha.cc by using<br>sendPaymentFailedNotification end alt avataxInvoiceFiling H->>AV: avataxInvoiceFiling Note right of H: Update of the tax associated with each order (only for US)<br>There is a "TaxTransactionType" attribute against the order.<br>If the value is Taxable then we run this process.<br>If the value is Non_Taxable, then go to the next step and do not send detail to Avalara H->>H: avataxInvoiceFiling-subprocess - invoiceAvaTax Note right of H: Subprocess triggered at this point. Retries a set number of times if there is an initial failure.<br>If this fails, there is no notification to the business, but the main order process will continue regardless end H->>H: sendOrderCompletedNotification Note right of H: Order status is updated to COMPLETED.<br>If it's a RCC/gift vouchers, email is triggered to customer with code H->>H: sendDeliveryMessage Note right of H: This sends the email to the customer to let them know that their order has been dispatched,<br>by triggering the separate sendDeliveryEmailProcess H->>H: sendDeliveryEmailProcess Note right of H: Sends email H->>N: sendOrderCompletedToNav Note right of H: Sends order status updated to NAV. If failing, there's a discrepancy between both systems

Resources