Assign Shipment

Warning

This documentation is for translated APIs and intended only for some implementations who have upgraded from a previous version of Order Management. Verify whether your implementation uses translated APIs before making this call, as you will experience errors if your tenant is not configured to use these. If your implementation is not configured to do so, then refer to the standard API documentation instead.

Much like the Assign Order API, the Assign Shipment API will assign a shipment to a fulfiller. It can do this either automatically or manually based on a provided Location ID.

This API can also be used to reassign, backorder, and cancel items from a shipment. For cancellation, the request body should only contain the items that will be rejected from the assignment. These actions can split shipments by assigning each item separately. See the examples for how to do this, but note that orders cannot be split once fulfilled. They can only be split while the shipment is in pullInventory or printPackingSlip. See the Transition State guide for an explanation of these states.

Note that the request body and parameter schemas outlined in this guide are the exact same as in the previous version of OMS, as the Unified Commerce platform supports backwards compatibility for this API. The only change to this request is the format of the base endpoint, as shown in the below table. Remember to provide the x-vol-tenant key for authentication in the headers.

Production URLhttps://{tenantId}-translation.mozu.com/api/v2/shipment/action/assign
Sandbox URLhttps://{tenantId}-translation.sandbox.mozu.com/api/v2/shipment/action/assign
Supported FormatsJSON
HTTP MethodPOST

Example

The example will demonstrate how to manage orders with the assignment, cancellation, and backorder structures for Assign Shipment calls. There are not different endpoints for each of these, only differences in the body content that determine what should be done with the shipment items.

Required Parameters

Each of the three actions that can be done to a shipment with this API require:

ParameterTypeDescription
shipmentIDintegerA unique identifier for the shipment. The minimum value is “1”.
sendEmailsbooleanShould emails be sent?
rectifyOrderbooleanShould the order be rectified?
packageAssignmentarrayThe details for how to assign the shipment. See the description of how to build this object below.

Package Assignment Options

The Package Assignment property can be defined by any of three possible options. One is the standard assign option, while the others are the cancel and backorder actions that can be performed by this API.

Note that even in cases where shipmentStatus is not a required parameter, the suggested best practice is to provide the status regardless. This will help ensure that OMS assigns the shipment as intended. While the rectifyOrder parameter does flag the order to be automatically placed into READY status, using shipmentStatus = “READY” is more reliable as it explicitly ensures that the shipment is assigned appropriately. RectifyOrder is best used as a back-up in a case where the user is not aware that the shipment should be manually assigned to READY.

When assigning a shipment with the SHIPPED status and it is a partial assignment case, the item assignment values will be split into a new shipment and the new child shipment will be fulfilled. In a full assignment case, the given shipment is fulfilled and there is no new shipment created.

Option One: Assign

The following properties are available to assign a shipment. AutoAssign, locationID, shippingAmount, shippingTaxAmount, and itemAssign are required.

ParameterTypeDescription
shipmentIDintegerA unique identifier for the shipment. The minimum value is “1”.
autoAssignbooleanWhether the order should be auto assigned to a fulfiller.
locationIDintegerA unique identifier for the fulfillment location. The minimum value is “1”.
shippingAmountnumberThe shipping amount of the shipment. The minimum value is “0”.
shippingTaxAmountnumberThe shipping tax amount of the shipment. The minimum value is “0”.
shippingTaxRatenumberThe shipping tax rate of the shipment. The minimum value is “0”.
shipmentStatusenumThe current status of the shipment (READY, ASSIGNED, or SHIPPED).
itemAssignobjectA list of the specific items being assigned. See below for the parameters to build this object.

Option Two: Cancel

Only one property is required to cancel a shipment assignment. When assigning a shipment with CANCELLED status, the item assignment values are split into a new shipment and the new child shipment will be cancelled while a cancel shipment notification is triggered. This matches OMS functionality where canceled items are not tracked on the same shipment as items that are ready to be fulfilled.

ParameterTypeDescription
shipmentStatusenumThe current status of the shipment (CANCELLED).
itemAssignobjectA list of the specific items being assigned. See below for the parameters to build this object.

Option Three: Backorder

To assign a shipment to backorder, use the following structure. Both parameters are required.

ParameterTypeDescription
shipmentStatusenumThe current status of the shipment (BACKORDER).
backOrderReleaseDatestringThe date the shipment will be released from backorder. Supports date-time format.
itemAssignobjectA list of the specific items being assigned. See below for the parameters to build this object.

Item Assign

Each of these options can be combined with an Item Assign (/packageAssignment/itemAssign/) object to specify the package items being assigned. The Item Assign parameters are listed below, but only an orderItemID is required.

ParameterTypeDescription
orderItemIDintegerA unique identifier for the order item. The minimum value is “0”.
itemTaxAmountnumberThe amount of tax on the order item. The minimum value is “0”.
itemTaxRatenumberThe rate of tax on the order item. The minimum value is “0”.
quantityintegerThe quantity of order items included.
dispositionReasonenumThe reason for the cancellation (customer_changed_mind, created_by_mistake, etc.).
dispositionOtherReasonstringIf dispositionReason is ’other’, provide an explanation here. The minimum length is 1 and the maximum length is 255.

The Assign Request

This is the entire request that will assign a shipment. There are two items defined in this sample, one being automatically assigned and the other manually assigned to Location 11111.

{  
   "shipmentID":0123456,
   "sendEmails":false,
   "rectifyOrder":true,
   "packageAssignment":[
   	  {  
         "autoAssign":false,
         "locationID":112344,
         "shippingAmount":4.99,
         "shippingTaxAmount":0,
         "itemAssign":[  
            {  
               "orderItemID":098765,
               "itemTaxAmount":0,
               "quantity":1
            }
         ]
      },
      {  
         "autoAssign":false,
         "locationID":01010,
         "shippingAmount":2.00,
         "shippingTaxAmount":0,
         "itemAssign":[  
            {  
               "orderItemID":0110110,
               "itemTaxAmount":0,
               "quantity":1
            }
         ]
      }
   ]
}

The returned response follows the same structure as the Get Shipment API, providing information about the shipment that was assigned.

The Cancel Request

The Item Assign block should only contain the items that will be rejected from the assignment.

{  
   "shipmentID":0123456,
   "sendEmails":false,
   "rectifyOrder":true,
   "packageAssignment":[  
      {  
         "shipmentStatus":"CANCELLED",
         "itemAssign":[  
            {  
               "orderItemID":434343
            }
         ]
      }
   ]
}

The returned response follows the same structure as the Get Shipment API, providing information about the shipment that was assigned.

The Backorder Request

This is the entire request that will place an order in backorder

{  
   "shipmentID":0123456,
   "sendEmails":false,
   "rectifyOrder":true,
   "packageAssignment":[  
      {  
         "shipmentStatus":"BACKORDER",
         "itemAssign":[  
            {  
               "orderItemID":89898989,
               "quantity":1,
               "backOrderDuration":7
            }
         ]
      }
   ]
}

The returned response follows the same structure as the Get Shipment API, providing information about the shipment that was assigned.