Order structure in OneStock

This page explains how orders are structured within OneStock and how the different objects relate to the order.

The structure of an order within the OMS is designed to represent the details of items that a customer has purchased. Each order consists of one or more order item(s), which are the individual products the customer has bought.

Order Items

An order item is a fundamental unit within an order that represents a single product (SKU, item) purchased by a customer. It gives the same view as the original purchase made by the customer.

Each order item includes a specified item and a quantity. The item must exist in OneStock. The quantity indicates the number of units of the associated product that the customer has ordered.

The order items don’t have a state. The state of the items are tracked in the line item groups (see below).

Line Item Groups

A line item group is a subdivision of an order item that allows for more granular tracking of specific aspects of the ordered item. It provides flexibility in managing complex orders with multiple quantities.

The line item groups have their own states, following a customizable workflow.

Each order item will be divided into one or more line item group(s), each representing distinct units of the purchased product. The number of line item groups may vary over time depending on the progress of the order processing.

Each line item group is linked to its parent order item. A quantity is associated to the line item group, that may be lower or equal to the quantity of the order item. The sum of the quantities of the line item groups associated to an order item is always equal to the quantity of the order item.

An index range is also associated to a line item group to identify which specific units of the items it contains.

Index ranges

An index range is a range of integers, starting from 0, that represents the different units of the items in the order. For example: an order with item A in 3 units, item B in 1 unit and item C in 5 units will have item A in the range from 0 to 2, item B from 3 to 3, item C from 4 to 8. In this example, if you cancel 1 unit of item A, item A would be split in 2 line item groups, with the index range 0-1 and its current state and with the index range 2-2, with the state “removed”.

The index ranges are automatically calculated by OneStock.

Parcels

A parcel corresponds to a preparation in a stock location. It may be a real package that will be shipped to the shipping address or a bag that will be prepared for collection in the store.

Each parcel is associated to a stock location, where it is prepared. In the store application, the parcel is created right after claiming the items. It may then be deleted if the order is unclaimed, or it may be split in 2 parcels when packing in multiple packages.

A parcel contains one or multiple units of items of the order. These units are indicated by their index ranges. A parcel contains a list of index ranges.

A specific index range, or a specific unit of an ordered item, cannot be contained in multiple parcels. It is contained in 0 or 1 parcel.

The parcels have their own states, following a customizable workflow.

Return parcels

A return parcel corresponds to the declaration of a return or to an actual return of one or multiple product. It may be any type of return: RMA (Return Merchandize Authorization), return to store, return to return center… Note that for pre-printed returns, the return parcel is usually created when receiving the items in the return center.

The return parcels have their own states, following a customizable workflow.

Each return parcel is associated to a stock location, where it will be / has been received.

A return parcel contains one or multiple units of items of the order. These units are indicated by their index ranges. A return parcel contains a list of return line item groups.

Return line item groups

The return line item groups are very similar to the line item groups (see above). They are associated to a single order item and to an index range.

A specific index range, or a specific unit of an ordered item, cannot be contained in multiple return parcels, except for specific states that are not counted, if they are listed in a configuration (states_to_ignore_for_duplicate_returned_line_items). That will be used for example, if an RMA is cancelled. You can keep track of the initial RMA and still return the item in another return.

The return line item groups have their own states, following a customizable workflow.