Search Parts
/rest/v7/parts/actions/search
Request
object-
context(optional):
object Part Search Context
Title:
Part Search ContextContext definition for part search. -
criteria(optional):
object Query Definition
Title:
Query DefinitionCaptures the query definition for the current resource request.
objectPart Search Context-
commerce(optional):
object Commerce Data
Title:
Commerce DataTransaction data for part search. -
config(optional):
object Configuration Data
Title:
Configuration DataConfiguration data for part search. -
pricebookVarName(optional):
string
Title:
Pricebook Variable NameString value that specifies the variable Name of the pricebook.
objectQuery Definition-
actions(optional):
array actions
Array of actions names, whose state is requested in the state object response.
-
childDefs(optional):
array childDefs
-
enableHierarchy(optional):
boolean
Parameter value should be true to execute hierarchy search and sort. Default value is false.
-
excludeFieldTypes(optional):
array excludeFieldTypes
Array of field names that you want to exclude in the response.
-
expand(optional):
array expand
Array of child resource names that you want to expand so that the contents return with the parent in the same request.
-
expandedDomains(optional):
array expandedDomains
Array of field names, whose expanded domains are requested in the state object response.
-
expandNodes(optional):
boolean
Boolean value that only be available when enableHierarchy is true. True = all nodes will be expanded; False = All nodes will be collapsed.Default value is true.
-
fields(optional):
array fields
Array of field names that you wanted returned in a request.
-
groups(optional):
array groups
Array of group names, whose state is requested in the state object response.
-
limit(optional):
integer
Positive integer value that specifies the maximum number of items returned by the server.
-
nodesExceptionList(optional):
array nodesExceptionList
Array of document_number, recording the nodes that violate current expandNodes flag
-
offset(optional):
integer
Non-negative integer values that specifies the index of the first item to be returned. The offset index begins at 0. By default, the offset is 0, which returns all items starting from the first item in the collection.
-
orderBy(optional):
array orderBy
Array of field names, each optionally followed by asc or desc, that specifies the order of items returned in the response payload.
-
q(optional):
string
Filter (a ??where??clause) to restrict the items returned in the collection. By default, no filtering is applied.
-
state(optional):
boolean
Boolean value that specifies whether to calculate the state property. By default, this value is set to false indicating that state is not calculated.
-
totalResults(optional):
boolean
Boolean value that specifies whether to calculate the totalResults property. By default, this value is set to false indicating that totalResults is not calculated.
objectCommerce Data-
cacheInstanceId(optional):
string
Title:
Cache Instance IdThe unique identifier for the entry of transaction data stored in the cache. This typically is obtained from first createTransaction or OpenTransaction action to avoid reload transaction data from db. -
currencyCode(optional):
string
Title:
Currency CodeThe currencyCode value in which the attribute is represented -
id(optional):
string
Title:
Transaction IdCurrent Unique Buyside ID of the transaction. -
mainDocument(optional):
object MainDocument Data
Title:
MainDocument DataThe transaction's main document data. -
process(optional):
object Process
Title:
ProcessThe transaction's process meta-data.
objectConfiguration Data-
allProducts(optional):
object All Products
Title:
All ProductsHolds attribute data that belong to all products -
currencyCode(optional):
string
Title:
Currency CodeThe currencyCode value in which the attribute is represented -
model(optional):
object ConfiguratorDataDefinition
Title:
ConfiguratorDataDefinitionHolds configurator related data like variable name and attribute values -
productLine(optional):
object ConfiguratorDataDefinition
Title:
ConfiguratorDataDefinitionHolds configurator related data like variable name and attribute values -
segment(optional):
object ConfiguratorDataDefinition
Title:
ConfiguratorDataDefinitionHolds configurator related data like variable name and attribute values
objectMainDocument Data-
attributes(optional):
object Attributes
Title:
AttributesA 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. -
variableName(optional):
string
Title:
MainDocument Variable NameThe variable name of the main document that the current transaction data belongs to.
objectProcess-
variableName(optional):
string
Title:
Process Variable NameThe variable name of the process that the current transaction data belongs to.
objectAttributesobjectAll Products-
attributes(optional):
object Attributes
Title:
AttributesA 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.
objectConfiguratorDataDefinition-
attributes(optional):
object Attributes
Title:
AttributesA 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. -
variableName(optional):
string
The variableName of the configurator entity like segment, productLine, model
arrayarray-
Array of:
object Child query criteria.
Title:
Child query criteria.Captures the query criteria for the child resource.
arrayarrayarrayarrayarrayarrayarrayobjectChild query criteria.-
name(optional):
string
Rest alias name of the child resource this query belongs to.
-
queryDef(optional):
object Query Definition
Title:
Query DefinitionCaptures the query definition for the current resource request. -
recursive(optional):
boolean
Boolean value that specifies whether this query is a recursive expand on the current child resource query.
Response
Default Response
object-
count(optional):
integer
The number of resource instances returned in the current range.
-
hasMore(optional):
boolean
Returns true if more resources are available on the server than the subset returned in current page.
-
items(optional):
array items
-
limit(optional):
integer
The actual paging size used by the server.
-
offset(optional):
integer
The offset used in the current page.
-
totalResults(optional):
integer
Capture the total count of the resource instances, which not only includes the instances in the current range, but all instances on the server that satisfy the request.
objectParts-
_part_custom_field1(optional):
string
Title:
String (Custom Field 1) -
_part_custom_field10(optional):
string
Title:
Required String (Custom Field 10) -
_part_custom_field11(optional):
object Required SSM (Custom Field 11)
Title:
Required SSM (Custom Field 11) -
_part_custom_field12(optional):
string
Title:
Undeployed Field -
_part_custom_field13(optional):
string
Title:
Custom Field 13 -
_part_custom_field14(optional):
string
Title:
Custom Field 14 -
_part_custom_field15(optional):
string
Title:
Custom Field 15 -
_part_custom_field16(optional):
object MSM (Custom Field 16)
Title:
MSM (Custom Field 16) -
_part_custom_field17(optional):
object MSM Filter (Custom Field 17)
Title:
MSM Filter (Custom Field 17) -
_part_custom_field18(optional):
string
Title:
Custom Field 18 -
_part_custom_field19(optional):
string
Title:
Custom Field 19 -
_part_custom_field2(optional):
object SSM (Custom Field 2)
Title:
SSM (Custom Field 2) -
_part_custom_field20(optional):
string
Title:
Custom Field 20 -
_part_custom_field21(optional):
string
Title:
Custom Field 21 -
_part_custom_field22(optional):
string
Title:
Custom Field 22 -
_part_custom_field23(optional):
string
Title:
Custom Field 23 -
_part_custom_field24(optional):
string
Title:
Custom Field 24 -
_part_custom_field25(optional):
string
Title:
Custom Field 25 -
_part_custom_field26(optional):
string
Title:
Custom Field 26 -
_part_custom_field27(optional):
string
Title:
Custom Field 27 -
_part_custom_field3(optional):
string
Title:
Page Specific Label (Custom Field 3) -
_part_custom_field30(optional):
string
Title:
Custom Field 30 -
_part_custom_field4(optional):
string
Title:
String Filter (Custom Field 4) -
_part_custom_field5(optional):
number
Title:
Float (Custom Field 5) -
_part_custom_field6(optional):
number
Title:
Float Filter (Custom Field 6) -
_part_custom_field7(optional):
integer
Title:
Integer (Custom Field 7) -
_part_custom_field8(optional):
object SSM Filter (Custom Field 8)
Title:
SSM Filter (Custom Field 8) -
_part_custom_field9(optional):
object Part Type (Custom Field 9)
Title:
Part Type (Custom Field 9) -
dateAdded(optional):
string
Title:
Date AddedSystem field indicating the date on which the Resource was created. -
dateModified(optional):
string
Title:
Date ModifiedSystem field indicating the date on which the Resource was last modified. -
description(optional):
string
Title:
DescriptionDescription of the part -
directBuy(optional):
object Direct Buy
Title:
Direct BuyDetermines how the part must be purchased. -
id(optional):
integer
Title:
IdPrimary Key of the part resource. -
leadTime(optional):
integer
Title:
Lead TimeTime taken in days for the part to be shipped. -
partDisplayNumber(optional):
string
Title:
Part Display NumberPart Number for display purpose. -
partNumber(optional):
string
Title:
Part NumberPart Number used to identify a part. -
partNumberLower(optional):
string
Title:
Part Number LowerUsed to store part number in lower case. -
units(optional):
string
Title:
UnitsNumber of units for the part number
objectRequired SSM (Custom Field 11)-
displayValue(optional):
string
Title:
Display ValueTranslated display name of the type for which fixed list of values can be defined. -
id(optional):
integer
Title:
IdPrimary Key of the fixed list of value resource. -
lookupCode(optional):
string
Title:
Lookup CodeLanguage independent code of the fixed list of value.
objectMSM Filter (Custom Field 17)objectSSM (Custom Field 2)-
displayValue(optional):
string
Title:
Display ValueTranslated display name of the type for which fixed list of values can be defined. -
id(optional):
integer
Title:
IdPrimary Key of the fixed list of value resource. -
lookupCode(optional):
string
Title:
Lookup CodeLanguage independent code of the fixed list of value.
objectSSM Filter (Custom Field 8)-
displayValue(optional):
string
Title:
Display ValueTranslated display name of the type for which fixed list of values can be defined. -
id(optional):
integer
Title:
IdPrimary Key of the fixed list of value resource. -
lookupCode(optional):
string
Title:
Lookup CodeLanguage independent code of the fixed list of value.
objectPart Type (Custom Field 9)-
displayValue(optional):
string
Title:
Display ValueTranslated display name of the type for which fixed list of values can be defined. -
id(optional):
integer
Title:
IdPrimary Key of the fixed list of value resource. -
lookupCode(optional):
string
Title:
Lookup CodeLanguage independent code of the fixed list of value.
objectDirect Buy-
displayValue(optional):
string
Title:
Display ValueTranslated display name of the type for which fixed list of values can be defined. -
id(optional):
integer
Title:
IdPrimary Key of the fixed list of value resource. -
lookupCode(optional):
string
Title:
Lookup CodeLanguage independent code of the fixed list of value.
object-
displayValue(optional):
string
Title:
displayValue -
value(optional):
string
Title:
value
object-
displayValue(optional):
string
Title:
displayValue -
value(optional):
string
Title:
value
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"
}
}