A shipping order is used to specify items that should be shipped, and is
typically exported to, and updated by a back-office warehouse management
system.
An Order can have n shipping orders expressing how the order
is to be shipped. The creation, export and update of shipping orders is
largely handled by custom logic in scripts by implementing
ShippingOrderHooks. Use method
Order.createShippingOrder() for creation and add items using
createShippingOrderItem(OrderItem, Quantity) - each item is related
to an order item which in turn represents a product- or shipping- line item
in the order.
A shipping order has a status calculated from its item status, one of
CONFIRMED - shipping order not yet exported, with 0 items, or all items in status CONFIRMED.
WAREHOUSE - shipping order exported, with all items in status WAREHOUSE.
SHIPPED - exported shipping order has been updated, with 1-n items in status SHIPPED and 0-n CANCELLED.
CANCELLED - exported shipping order has been updated, with all items in status CANCELLED.
The following status transitions are supported. Every status transition is
documented by the addition of an order note such as ‘Shipping order 123456
status changed to WAREHOUSE.’:
From
To
When
Use
CONFIRMED
WAREHOUSE
Shipping order exported
Call setStatusWarehouse() - note this is the only way to set the items to status WAREHOUSE
Order post-processing APIs (gillian) are now inactive by default and will throw
an exception if accessed. Activation needs preliminary approval by Product Management.
Please contact support in this case. Existing customers using these APIs are not
affected by this change and can use the APIs until further notice.
Set a CONFIRMED shipping order (all items in status CONFIRMED) to status WAREHOUSE (all items in status WAREHOUSE). Note - this method is the only way to transition a shipping order from CONFIRMED to WAREHOUSE.
Creates a new Invoice based on this
ShippingOrder.
The shipping-order-number will be used as the
invoice-number. The Invoice can then be accessed using
getInvoice() or getInvoiceNumber() can be used.
The method must not be called more than once for a ShippingOrder,
nor may 2 Invoices exist with the same invoice-number.
The new Invoice is a debit-invoice with a status
Invoice.STATUS_NOT_PAID, and will be passed to the
capture payment-hook in a separate database transaction for processing.
Creates a new Invoice based on this ShippingOrder.
The invoice-number must be specified as an argument.The Invoice can then be accessed using
getInvoice() or getInvoiceNumber() can be used.
The method must not be called more than once for a ShippingOrder,
nor may 2 Invoices exist with the same invoice-number.
The new Invoice is a debit-invoice with a status Invoice.STATUS_NOT_PAID, and
will be passed to the capture payment-hook in a separate database
transaction for processing.
Create a ShippingOrderItem in the shipping order with
the number shippingOrderNumber.
The quantity of the new item can be optionally specified. A quantity of
null indicates the new item should be based on the entire order item and
is recommended for ShippingLineItems. If a quantity is
specified for a ProductLineItem which is less than
ProductLineItem.getQuantity() the
ProductLineItem will be split, creating a new
ProductLineItem. The new
ShippingOrderItem will be associated with the new
ProductLineItem, which will receive the specified
quantity.
See also createShippingOrderItem(OrderItem, Quantity, Boolean).
Parameters:
quantity - the quantity for which the shipping order item will be created
orderItem - the order item for which the shipping order item is to be created
Create a ShippingOrderItem in the shipping order with
the number shippingOrderNumber.
The quantity of the new item can be optionally specified. A quantity of
null indicates the new item should be based on the entire order item and
is recommended for ShippingLineItems.
If the specified quantity is less than ProductLineItem.getQuantity() the
ProductLineItem will be split or not depending on splitIfPartial parameter.
When split is true, the method is equivalent to
createShippingOrderItem(OrderItem, Quantity).
Parameters:
quantity - the quantity for which the shipping order item will be created, not null
orderItem - the order item for which the shipping order item is to be created
splitIfPartial - the flag whether ProductLineItem should be split when requested quantity is less than ProductLineItem's quantity