This API will assign an order to a fulfiller, either automatically or manually based on a provided Location ID. The Assign Order API can also be used to reassign, backorder, and cancel items.
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 URL | https://{tenantId}-translation.mozu.com/api/v2/order/action/assign |
Sandbox URL | https://{tenantId}-translation.sandbox.mozu.com/api/v2/order/action/assign |
Supported Formats | JSON |
HTTP Method | POST |
Example
The example will demonstrate how to manage orders with the assignment, cancellation, and backorder structures for Assign Order calls. There are not different endpoints for each of these, only differences in the body content that determine what should be done with the order items.
Required Parameters
Each of the three actions that can be done to an order with this API require:
Parameter | Type | Description |
orderID | integer | A unique identifier for the order. The minimum value is “1”. |
sendEmails | boolean | Should emails be sent? |
rectifyOrder | boolean | Should the order be rectified? |
packageAssignment | array | The details for how to assign the shipment. |
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 order 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 order is assigned appropriately. RectifyOrder is best used as a back-up in a case where the user is not aware that the order should be manually assigned to READY.
Option One: Assign
The following properties are available to assign an order. At least one of autoAssign, locationID, shippingAmount, shippingTaxAmount, and itemAssign are required.
Parameter | Type | Description |
shipmentID | integer | A unique identifier for the shipment. The minimum value is “1”. |
autoAssign | boolean | Whether the order should be auto assigned to a fulfiller. |
locationID | integer | A unique identifier for the fulfillment location. The minimum value is “1”. |
shippingAmount | number | The shipping amount of the shipment. The minimum value is “0”. |
shippingTaxAmount | number | The shipping tax amount of the shipment. The minimum value is “0”. |
shippingTaxRate | number | The shipping tax rate of the shipment. The minimum value is “0”. |
shipmentStatus | enum | The current status of the shipment (READY or ASSIGNED). |
itemAssign | object | A 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 an order assignment.
Parameter | Type | Description |
shipmentStatus | enum | The current status of the shipment (CANCELLED). |
itemAssign | object | A list of the specific items being assigned. See below for the parameters to build this object. |
Option Three: Backorder
To assign an order to backorder, use the following structure. Both parameters are required.
Parameter | Type | Description |
shipmentStatus | enum | The current status of the shipment (BACKORDER). |
backOrderReleaseDate | string | The date the shipment will be released from backorder. Supports date-time format. |
itemAssign | object | A 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.
Parameter | Type | Description |
orderItemID | integer | A unique identifier for the order item. The minimum value is “0”. |
itemTaxAmount | number | The amount of tax on the order item. The minimum value is “0”. |
itemTaxRate | number | The rate of tax on the order item. The minimum value is “0”. |
quantity | integer | The quantity of order items included. |
dispositionReason | enum | The reason for the cancellation (customer_changed_mind, created_by_mistake, etc.). |
dispositionOtherReason | string | If 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 an order. There are two items defined in this sample, one being automatically assigned and the other manually assigned to Location 01010.
{ "orderID":6543210, "sendEmails":false, "rectifyOrder":true, "packageAssignment":[ { "autoAssign":true, "itemAssign":[ { "orderItemID":0123456, "quantity":1 } ] }, { "autoAssign":false, "locationID":01010, "itemAssign":[ { "orderItemID":6789012, "quantity":1 } ] } ] }
The returned response follows the same structure as the Get Order API, providing information about the order that was assigned.
The Cancel Request
The cancellation configuration rejects individual items, so they are each defined here with their own disposition reasons. The Item Assign block should only contain the items that will be rejected from the assignment.
{ "orderID":0123456, "sendEmails":true, "rectifyOrder":true, "packageAssignment": [ { "shipmentStatus": "CANCELLED", "itemAssign": [ { "orderItemID": 998887, "quantity": 1, "dispositionReason":"customer_changed_mind" }, { "orderItemID": 7776665, "quantity": 1, "dispositionReason":"created_by_mistake" } ] } ] }
The returned response follows the same structure as the Get Order API, providing information about the order that was assigned.
The Backorder Request
This is the entire request that will place an order in backorder.
{ "orderID":6543210, "sendEmails":true, "rectifyOrder":true, "packageAssignment":[ { "shipmentStatus":"BACKORDER", "backOrderReleaseDate":"2016-12-30T00:00:00+00:00", "itemAssign":[ { "orderItemID":098765, "quantity":3 } ] } ] }
The returned response follows the same structure as the Get Order API, providing information about the order that was assigned.