The Cancel Order Item API allows an item associated with an order to be canceled after its generation with an order.
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/orderItem/action/cancel/ |
Sandbox URL | https://{tenantId}-translation.sandbox.mozu.com/api/v2/orderItem/action/cancel/ |
Supported Formats | JSON |
HTTP Method | POST |
Example
This example case will cancel an existing order item. The important properties:
- Order Item 12345678
- Canceled due to lack of quantity
This guide will demonstrate how to put together each section of the request to cancel this item.
Required Parameters
The parameters required to cancel an order item are:
Parameter | Type | Description |
orderItemID | integer | A unique identifier for the order item. The minimum value is “0”. |
dispositionReason | enum | The reason for the cancellation (can_not_find_item, not_enough_quantity, not_web_sellable, on_mannequin_or_display, item_on_reserve, no_inventory, or other). |
rectifyOrder | boolean | Should order payment be rectified? The default is “TRUE” so that even if this is not provided in the request, the parameter will be automatically set to the suggested best practice of rectification. |
Optional Parameters
These are the other details that can be provided when canceling an order item:
Parameter | Type | Description |
cancelChildItems | boolean | In the case of an item on a transfer order being canceled, should the associated child items be canceled too? The default is “false.” |
dispositionOtherReason | string | Custom reason if ’other’ was used for the dispositionReason. The minimum length is “1” and the maximum length is “255”. |
sendCancellationEmails | boolean | Should cancellation emails be sent? |
The Full Request
This is the entire request that will cancel an order item.
{ "orderItemID":12345678, "dispositionReason":"not_enough_quantity", "rectifyOrder":true, "sendCancellationEmails":false, "cancelChildItems":false }
The returned response follows the same structure as the Get Order Item API, providing information about the order item that was edited.