The Lifecycle of an Order: A Step-by-Step Journey

This document tells the story of a single order from the moment a customer clicks “Place Order” to the final accounting entry, providing a clear, non-technical narrative of the entire automated process.

Scenario: A student from “Academy of Work” logs in and purchases a physical textbook.


Step 1: The Customer Places an Order

  • Action: The student adds the textbook to their cart and completes the checkout process.
  • Behind the Scenes:
    • Because the student is logged in, the system recognizes their “Academy of Work Student” role.
    • The price they see is the specific price for that institution, pulled from the Zoho pricelist.
    • The system calculates the weight of the textbook and looks up the correct shipping cost from the pre-configured rate table.
    • The student pays, and a new order is created in WooCommerce.

Step 2: The System Springs into Action

  • Action: The WooCommerce order status is set to “Processing”.
  • Behind the Scenes:
    • The EDGE Store plugin detects this status change and immediately triggers its order-sync process.
    • The plugin analyzes the order and sees that it contains a physical textbook (based on its SKU). This is the critical decision point.

Step 3: Fulfilment - Sending the Order to the Printer

  • Action: The plugin sends the order to ColourTech.
  • Behind the Scenes:
    • The plugin makes an API call to ColourTech, sending only the necessary information:
      • The student’s shipping address.
      • The textbook’s SKU and the quantity (1).
    • ColourTech’s system accepts the order and returns a unique ID, which is saved to the WooCommerce order for future tracking. The printing and shipping process now begins at ColourTech.

Step 4: Accounting - The Customer Invoice

  • Action: The plugin creates a sales invoice in Xero.
  • Behind the Scenes:
    • The plugin makes a second API call, this time to Xero.
    • It creates a new sales invoice for the full amount the student paid (textbook price + shipping).
    • This invoice is automatically assigned to the student’s contact record in Xero. If the contact doesn’t exist, the plugin creates it.

Step 5: Accounting - The Supplier Bill

  • Action: The plugin creates a bill in Xero for the cost of the textbook.
  • Behind the Scenes:
    • Because the order contained a physical product, the plugin makes a third API call to Xero.
    • It creates a new bill that is payable to the “ColourTech” contact in Xero.
    • The amount of the bill is the cost price of the textbook, which was originally synced from Zoho. This correctly records the Cost of Goods Sold (COGS).

Conclusion

In the few seconds after the student clicked “Place Order”, the system has:

  1. Sent the order to the printer for fulfillment.
  2. Recorded the sale in the accounting system.
  3. Recorded the cost of the sale in the accounting system.

This entire end-to-end process is fully automated, ensuring efficiency and accuracy from purchase to fulfillment and accounting.