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 |
WAREHOUSE | SHIPPED | One or more items have been SHIPPED | Call ShippingOrderItem.setStatus(String) using ShippingOrderItem.STATUS_SHIPPED |
WAREHOUSE | CANCELLED | All items have been CANCELLED | Call ShippingOrderItem.setStatus(String) using ShippingOrderItem.STATUS_CANCELLED |
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.
null
or the invoice-number.This FilteringCollection could be sorted / filtered using:
Returns null
if this shipping order is not yet shipped.
Note: the shipping address is not copied into the ShippingOrder but is a link to a OrderAddress held in the Order.
Can be null
.
The possible values are STATUS_CONFIRMED, STATUS_WAREHOUSE, STATUS_SHIPPED, STATUS_CANCELLED.
shippingOrderNumber
.shippingOrderNumber
.null
or the invoice-number.Note - this method is the only way to transition a shipping order from CONFIRMED to WAREHOUSE.
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.
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.
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).
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).
null
or the invoice-number.null
or the previously created invoice number.
This FilteringCollection could be sorted / filtered using:
Returns null
if this shipping order is not yet shipped.
null
Note: the shipping address is not copied into the ShippingOrder but is a link to a OrderAddress held in the Order.
null
Can be null
.
null
The possible values are STATUS_CONFIRMED, STATUS_WAREHOUSE, STATUS_SHIPPED, STATUS_CANCELLED.
null
Note - this method is the only way to transition a shipping order from CONFIRMED to WAREHOUSE.