Search Parts

post

/rest/v7/parts/actions/search

The Search Parts REST API supports eligibility checking and filtering for the following scenarios: Search Parts using Configuration Context, Search Parts using Commerce Context, Perform a Quick Key Part Search, Search a List of Part Numbers, and Perform an Advanced Part Search.

Request

Body ()
Root Schema : parts-searchRequest
Type: object
Show Source
Nested Schema : Part Search Context
Type: object
Title: Part Search Context
Context definition for part search.
Show Source
Nested Schema : Query Definition
Type: object
Title: Query Definition
Captures the query definition for the current resource request.
Show Source
Nested Schema : Commerce Data
Type: object
Title: Commerce Data
Transaction data for part search.
Show Source
Nested Schema : Configuration Data
Type: object
Title: Configuration Data
Configuration data for part search.
Show Source
Nested Schema : MainDocument Data
Type: object
Title: MainDocument Data
The transaction's main document data.
Show Source
  • Attributes
    Title: Attributes
    A set of key, value pairs with key being attribute's variableName and value being the value of the attribute.If its an msm, it can take list of values in items array.
  • Title: MainDocument Variable Name
    The variable name of the main document that the current transaction data belongs to.
Nested Schema : Process
Type: object
Title: Process
The transaction's process meta-data.
Show Source
Nested Schema : Attributes
Type: object
Title: Attributes
A set of key, value pairs with key being attribute's variableName and value being the value of the attribute.If its an msm, it can take list of values in items array.
Nested Schema : All Products
Type: object
Title: All Products
Holds attribute data that belong to all products
Show Source
  • Attributes
    Title: Attributes
    A set of key, value pairs with key being attribute's variableName and value being the value of the attribute.If its an msm, it can take list of values in items array.
Nested Schema : ConfiguratorDataDefinition
Type: object
Title: ConfiguratorDataDefinition
Holds configurator related data like variable name and attribute values
Show Source
Nested Schema : actions
Type: array
Array of actions names, whose state is requested in the state object response.
Show Source
Nested Schema : childDefs
Type: array
Show Source
Nested Schema : excludeFieldTypes
Type: array
Array of field names that you want to exclude in the response.
Show Source
Nested Schema : expand
Type: array
Array of child resource names that you want to expand so that the contents return with the parent in the same request.
Show Source
Nested Schema : expandedDomains
Type: array
Array of field names, whose expanded domains are requested in the state object response.
Show Source
Nested Schema : fields
Type: array
Array of field names that you wanted returned in a request.
Show Source
Nested Schema : groups
Type: array
Array of group names, whose state is requested in the state object response.
Show Source
Nested Schema : nodesExceptionList
Type: array
Array of document_number, recording the nodes that violate current expandNodes flag
Show Source
Nested Schema : orderBy
Type: array
Array of field names, each optionally followed by asc or desc, that specifies the order of items returned in the response payload.
Show Source
Nested Schema : Child query criteria.
Type: object
Title: Child query criteria.
Captures the query criteria for the child resource.
Show Source
Back to Top

Response

Default Response

Body ()
Root Schema : parts-searchResponse
Type: object
Show Source
Nested Schema : parts-collection
Type: object
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : Parts
Type: object
Title: Parts
Show Source
Nested Schema : Required SSM (Custom Field 11)
Type: object
Title: Required SSM (Custom Field 11)
Show Source
Nested Schema : MSM (Custom Field 16)
Type: object
Title: MSM (Custom Field 16)
Show Source
Nested Schema : MSM Filter (Custom Field 17)
Type: object
Title: MSM Filter (Custom Field 17)
Show Source
Nested Schema : SSM (Custom Field 2)
Type: object
Title: SSM (Custom Field 2)
Show Source
Nested Schema : SSM Filter (Custom Field 8)
Type: object
Title: SSM Filter (Custom Field 8)
Show Source
Nested Schema : Part Type (Custom Field 9)
Type: object
Title: Part Type (Custom Field 9)
Show Source
Nested Schema : Direct Buy
Type: object
Title: Direct Buy
Determines how the part must be purchased.
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top

Examples

The Search Parts REST API supports customizing the REST response by specifying an advanced query object (i.e. "q" criteria) as a request body parameter. This allows administrators to customize the query by specifying various combinations of criteria.

The following examples show how to search parts by submitting a POST request to the REST resource using cURL. For more information about cURL, see Use cURL.

curl - X POST - i - H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQg" - H "Content-type: application/json"
https://sitename.oracle.com/rest/v7/parts/actions/search

Search Parts Using Configuration Context

This operation is used to search parts based on Configuration attribute values. If account and user information is available in the authentication token, Eligibility Rules created on user and account attributes are applied.

Request Body Sample

{
   "criteria": {
      "totalResults": true,
      "limit": 15,
      "offset": 0,
      "fields": ["partNumber", "_part_custom_field8", "_part_custom_field9", "_part_custom_field11", "_part_custom_field17", "directBuy", "units", "leadTime", "partDisplayNumber"],
      "q": "{\"partNumber\":{\"$like\": \"EligibilityForPartRESTAPICONFIGPart%\"}}"
   },
   "context": {
      "pricebookVarName": "pricebook1",
      "config": {
         "allProducts": {
            "attributes": {
               "conditionsAllPF": "true"
            }
         },
         "segment": {
            "variableName": "testbed",
            "attributes": {
               "aVPMSMCheckboxesOther": {
                  "items": ["Value 1"]
               }
            }
         },
         "productLine": {
            "variableName": "recommendedItems",
            "attributes": {
               "advancedCondition1": "true"
            }
         },
         "model": {
            "variableName": "performance",
            "attributes": {
               "numberOfLineItems": "50"
            }
         }
      }
   }
}

Search Parts Using Commerce Context

When an Eligibility Rule is based on a Commerce attribute and a Transaction is created with values that satisfy the Eligibility Rule, this operation is used to search for parts using Transaction data.

Request Body Sample

{
   "criteria": {
      "totalResults": true,
      "limit": 15,
      "offset": 0,
      "fields": ["partNumber", "_part_custom_field8", "_part_custom_field9", "_part_custom_field11", "_part_custom_field17", "directBuy", "units", "leadTime", "partDisplayNumber"],
      "q": "{\"partNumber\":{\"$like\": \"Basic Pricing 01\"}}"
   },
   "context": {
      "pricebookVarName": "pricebook1",
      "commerce": {
         "id": "20587705"
      }
   }
}

Perform a Quick Key Search in Commerce

In a CPQ Cloud Transaction, Quick Key line items are used to add parts to a quote without navigating away from the Transaction page and to auto - suggest a part to aid in part selection.The Search Part REST API allows implementers to build similar functionality where the Quick Key part selector auto - populates with part numbers when users enter characters into an item field in the Line Item Grid.

Request Body Sample

{
   "context": {
      "pricebookVarName": "pricebook1",
      "commerce": {
         "id": "20516360",
         "cacheInstanceId": "3KR11zuA1UZzhlH2ohStrgwgRrlrYa9YbrSIY2OofoRPBbluv8MCYfm40Ag33nGP"
      }
   },
   "criteria": {
      "q": "{\"partNumber\":{$like: \"part2690%\", $options:\"I\"}}",
      "fields": ["partDisplayNumber", "partNumber"],
      "totalResults": true,
      "limit": 10,
      "offset": 0
   }
}

Notes:

  • If cacheInstanceId is present, the id and process data are ignored.
  • If cacheInstanceId is not present and id is present, the id is used.
  • If cacheInstanceId and id are not available, Commerce attribute values are passed.

Search List of Part Numbers

Used to filter a given list of parts. The list of parts is provided in the "q" parameter(concatenated with 'OR') of the criteria object.

Request Body Sample

{
   "context": {
      "pricebookVarName": "pricebook1",
      "commerce": {
         "id": "20104203"
      }
   },
   "criteria": {
      "q": "{ $or: [ { \"partNumber\": { $eq: \"part2690\" }}, { \"partNumber\": { $eq: \"part2691\" }} ] }"
   }
}

Perform an Advanced Part Search

This operation is used to search for parts using a single or combination of multiple part fields with Eligibility Rules applied. The part search criteria supports operators based on field type.

Request Body Sample

Search parts based on a part custom field, such as an MSM field.As shown in the below example, any MSM field can be searched using the value attribute.

{
   "criteria": {
      "totalResults": true,
      "limit": 5,
      "offset": 0,
      "fields": ["_part_customfield16", "partNumber"],
      "q": "{$and:[{partNumber:\"EligibilityForPartRESTAPIPart3\"},{\"_part_customfield16.value\":{$ne:[\"Value 1\"]}}]}"
   },
   "context": {
      "pricebookVarname": "pricebook1"
   }
}
Back to Top