Ordering workflow
Understand Lightspeed Ordering workflow
Overview
Orders move through a series of statuses from creating to being delivered.
Orders can take on the following statuses:
STATUS | DESCRIPTION | POSSIBLE ACTIONS |
---|---|---|
OrderOpen | Starting status for all orders; at this point, the order can still be edited | Add line items, remove line items, delete it, submit it |
OrderSubmitted | The order has been submitted, and is now awaiting approval from the supplier. It can no longer be edited. | Process it, cancel it |
OrderProcessing | The order is being processed by the supplier. | Finalize it to Completed , Cancel it, |
OrderCompleted | The order has been completed entirely. | – |
OrderCancelled | There was an issue during the process and the order needed to be cancelled. | – |
OrderDeleted | This 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.
STATUS | API ENDPOINT | END STATUS |
---|---|---|
OrderOpen | DELETE /orders/:id | OrderDeleted |
OrderOpen | PUT /orders/:id withstatus=OrderSubmitted | OrderSubmitted |
OrderSubmitted | PUT /orders/:id withstatus=OrderProcessing | OrderProcessing |
OrderProcessing | PUT /orders/:id withstatus=OrderCancelled | OrderCancelled |
OrderProcessing | PUT /orders/:id withstatus=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"
}'
Updated over 4 years ago