Search Orders Using ccAdmin searchOrders Endpoint For New OrderType Order Properties (Doc ID 2199345.1)

Last updated on NOVEMBER 17, 2016

Applies to:

Oracle Commerce Cloud Service - Version N/A and later
Information in this document applies to any platform.

Goal

Within the /ccagent/v1/orders endpoint, it possible to search for custom properties on existing orders?

Example

A new custom property has been created for the 'order' OrderType:

newSearchProp

This was done through the use of the updateOrderType endpoint:

PUT ccadmin/v1/orderTypes/order
{
  "properties" : {
    "newSearchProp" : {
        "label": "newSearchProp",
        "textSearchable": true,
        "multiSelect": null,
        "dimension": false,
        "internalOnly": false,
        "default": "null",
        "required": true,
        "searchable": true
    }
  }
}

 Making a request of the getOrderType endpoint, the new order property is seen:

GET ccadmin/v1/orderTypes/order
RESPONSE:
{
  "properties": {
  "newSearchProp": {
    "writable": true,
    "localizable": false,
    "label": "newSearchProp",
    "type": "shortText",
    "uiEditorType": "shortText",
    "textSearchable": true,
    "multiSelect": null,
    "dimension": false,
    "internalOnly": false,
    "default": "null",
    "editableAttributes": [
      "textSearchable",
      "multiSelect",
      "dimension",
      "internalOnly",
      "default",
      "label",
      "required",
      "searchable"
    ],
    "length": 254,
    "required": true,
    "searchable": true
  }
}

 However, after saving orders with that field value of 'newPropTxt', attempting to then search for this attribute via the ccAgent searchOrders endpoint does not retrieve results:

GET /ccagent/v1/orders?q={pageNumber=0,limit=20,newSearchProp='newPropTxt',sortOrder='ascending'}&fields=id,priceInfo.currencyCode,newSearchProp
RESPONSE:
{
  "ordersList": [],
  "totalOrders": 0,
}

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms