Custom Order Data

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.

To edit custom order data after order creation, an additional API is available to manage that data directly and more efficiently. POST, PUT, DELETE, and GET requests are all supported by this Custom Order Data API to manage that information.

Although this is related to the Custom Order Item Data API, this API pertains only to the custom data applied to a whole order. Custom data made at the line item or product level should be managed through the Custom Order Item Data API.

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/order/{orderID}/customData
Sandbox URLhttps://{tenantId}-translation.sandbox.mozu.com/api/v2/order/{orderID}/customData
Supported FormatsJSON
HTTP MethodPOST, PUT, DELETE, GET

Required Parameters

These parameters are necessary for the Custom Order Data API to return a successful response for POST and PUT requests, which require a body.

ParameterTypeDescription
namestringThe name of the value in the value store of custom data. The minimum length is 1 and the maximum length is 100.
valuestringThe data for the value portion of the key/value store of custom data. The minimum length is 1 and the maximum length is 1000.

Optional Parameters

Other possible parameters can be provided to specify other details about the order.

ParameterTypeDescription
orderCustomDataIDintegerA unique identifier for each custom data record.
orderIDintegerA unique identifier for the order that the data applies to. The minimum value is “1”.
manufacturerIDintegerA unique identifier for the manufacturer that the order belongs to. The minimum value is “1”.
catalogIDintegerThe catalog number for the manufacturer. The minimum value is “0”.

Add Custom Order Data

The POST request will add a new custom data record to an existing order. The header specifies the Order ID of the order being edited, and references the /customData API endpoint to differentiate this call from any other Order API call.

The header:

https://{tenantId}-translation.mozu.com/api/v2/order/000000/customData

Only the name and value of the custom data are required. The order ID is assumed from the header and the custom data ID will be generated by OMS and returned in the response.

The body:

 {
  "name": "Example Data",
  "value": "This is sample custom data."
 }

Update Custom Order Data

The PUT request will update an existing custom data record. The header specifies the Order ID of the order being edited, as well as the Custom Order Data ID that is known from the existing order information. This ID can be found in the response of any call that returns order information.

The header:

https://{tenantId}-translation.mozu.com/api/v2/order/000000/customData/111111

Although the name of the custom data record is included in the body as shown below, it must be the name of an existing record and cannot be changed. Only the value may be different from the existing record.

The body:

 {
  "name": "Example Data",
  "value": "This is new text for the sample custom data."
 }

Delete Custom Order Data

The DELETE request will remove an existing custom data record. There is no required body of the request, as the header specifies which data element is being deleted based on the customDataID. This ID can be found in the response of any call that returns order information.

The header:

https://{tenantId}-translation.mozu.com/api/v2/order/000000/customData/111111

This data will be removed and a “204 No Content” response message will be returned to indicate such.

Get Custom Order Data

The GET request will simply return the custom data of an order. This request can be made in two ways, as shown below. The first header only specifies an orderID, so the response will return all custom data blocks that belong to the order. The second option specifies a particular orderCustomDataID, so only the block with that ID will be returned.

The headers:

https://{tenantId}-translation.mozu.com/api/v2/order/000000/customData
https://{tenantId}-translation.mozu.com/api/v2/order/000000/customData/111111

The information in the body of the response is also often returned as the response of other requests that do make edits, such as the PUT call. A 404 Error will be returned if the user tries to access the data of an order that does not exist.

The body:

{
   "orderCustomDataID": 11111,
   "orderID": 00000,
   "manufacturerID": 010101,
   "catalogID": 4,
   "name": "Custom Data",
   "value": "This is sample custom data."
}