Working with orders and parcels within Foxdeli
Concept of Order
within the Foxdeli Customer Service API represents the entire purchasing process, which may include one or more parcels. Parcels are individual packages that contain products from the order and are delivered to the customer.
Order and Parcel creation Process
When you create an order, the CREATED event occurs even without the presence of a parcel, which can trigger the sending of an email if you have it set up in the workflow (in the Foxdeli application).
The correct procedure here is to create an order and then a parcel, even if you don't have data from the carrier yet. A parcel practically represents the box into which you place the products.
You can then move the parcel to other states via: Update parcel state.
Once you update the parcel with tracking data, Foxdeli takes over the management of states and automatically moves the parcel according to the shipping statuses and adjusts the order status in Foxdeli accordingly.
It indirectly follows that, except for special cases, the order status is a "composite" status derived from individual parcels. This makes the system more flexible and able to handle situations where an order has multiple parcels traveling to the destination customer from different locations, even with different tracking numbers.