Ordering workflow

Understand Lightspeed Ordering workflow

Overview

Orders move through a series of statuses from creating to being delivered.

837

Orders can take on the following statuses:

STATUSDESCRIPTIONPOSSIBLE ACTIONS
OrderOpenStarting status for all orders; at this point, the order can still be editedAdd line items, remove line items, delete it, submit it
OrderSubmittedThe order has been submitted, and is now awaiting approval from the supplier. It can no longer be edited.Process it, cancel it
OrderProcessingThe order is being processed by the supplier.Finalize it to Completed, Cancel it,
OrderCompletedThe order has been completed entirely.
OrderCancelledThere was an issue during the process and the order needed to be cancelled.
OrderDeletedThis order was a mistake, and should be deleted

These statuses allow for orders to be drafted and revised before finalizing them, sending them to suppliers.

Canceling orders

To delete, or effectively undo an order that has already been finalized, you can cancel it. Canceling is similar to deleting an order, but maintains a record of when it was created, finalized, then canceled.

Completing orders

Finally, the completed status is simply used for orders that are completed. Orders are manually marked as completed when a supplier has processed the order through Lightspeed.

Workflow transitions

In this section we’ll cover the transitions that orders can make between statuses.

Order status transition endpoints and webhooks

The following table outlines the status transitions and their endpoints—along with the webhooks emitted by the endpoint, and the resulting status for each.

STATUSAPI ENDPOINTEND STATUS
OrderOpenDELETE /orders/:idOrderDeleted
OrderOpenPUT /orders/:id with
status=OrderSubmitted
OrderSubmitted
OrderSubmittedPUT /orders/:id with
status=OrderProcessing
OrderProcessing
OrderProcessingPUT /orders/:id with
status=OrderCancelled
OrderCancelled
OrderProcessingPUT /orders/:id with
status=OrderCompleted
OrderCompleted

Submitting draft orders

Orders are initially created with status=OrderOpen, and is the only state in which an order can be edited.

Once an order is ready to be completed, it should be finalized. As a retailer you can submit your order for review by setting status=OrderSubmitted.

Let's take a look on how to finalize an order programmatically:

curl --location --request PUT 'https://lsapi-supplier-orders.lightspeedappstg.com/orders/$ORDER_ID' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $LIGHTSPEED_API_TOKEN' \
--data-raw '{
    "status": "OrderSubmitted"
}'

Deleting draft orders

You can delete a draft order at any time.

curl --location --request DELETE 'https://lsapi-supplier-orders.lightspeedappstg.com/orders/$ORDER_ID'

Completing an order

When an order gets completed, the order is moved into the completed status. This status is terminal, which means that completed orders can never take on another status.

curl --location --request PUT 'https://lsapi-supplier-orders.lightspeedappstg.com/orders/$ORDER_ID' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $LIGHTSPEED_API_TOKEN' \
--data-raw '{
    "status": "OrderCompleted"
}'