searchOrders
get
/ccagent/v1/orders
Search Orders. Lists the orders corresponding to the given profileId. Optionally takes X-CCOrganization header which is a JSON field with organization ID as value. If this header is not provided, then the endPoint will consider first active organization as the current organization for a B2B user.
Request
Supported Media Types
- application/json
Query Parameters
-
limit: integer
The batch size of the order records to be fetched together.
-
offset: integer
The start index of the list of order records to be fetched.
-
profileId: string
The customer profile id.
-
q(optional): string
Search criteria to filter the search results based on various fields like first Name etc. It is required if profileId is null. Following are the fields supported by this param: |Field|Type|Description| |------------------|------------------|------------------| |lastName|string|Last Name of the customer profile| |pageNumber|integer|The page number for pagination| |shippingAddressState|string|State for shipping address | |orderId|string|Order Id of the order| |endDate|string|Date till which search has to be made| |billingAddressFirstName|string|First name of the billing address| |billingAddressLastName|string|Last name of billing address| |limit|integer|The batch size of the order records to be fetched together.| |state|string|state of the order eg. PENDING_PAYMENT| |billingAddressAddressLine2|string|Address Line 2 for billing address| |billingAddressPostalCode|string|Postal code for billing address| |billingAddressAddressLine1|string|Address Line 1 for billing address| |email|string|Email id of the customer profile| |skuId|string|SKU ID of the product| |shippingAddressCity|string|City for shipping address | |billingAddressCity|string|City for billing address | |productId|string|Product ID product| |shippingAddressFirstName|string|First Name of shipping address| |shippingAddressLastName|string|Last name of shipping address| |shippingAddressCountry|string|Country for shipping address | |billingAddressState|string|State for billing address | |firstName|string|First Name of the customer profile| |addressPhone|string|Phone Number of the customer profile| |siteId|string|Site Id of the Order. If Shared cart feature is enabled, the endpoint will search for Orders in all Sharing Sites in the Site Group| |shippingAddressPostalCode|string|Postal code for shipping address| |billingAddressCountry|string|Country for billing address | |startDate|string|Date to start searching from like "yyyy-mm-ddThh:mm:ss.sssz" | Searching with custom properties: For Text Search, add prefix "dynProps_" (case sensitive) to the name of custom property being searched. For example: For a custom property with name as GiftWrap, use search criteria field as dynProps_GiftWrap. For SCIM Search, use the custom property name as the search criteria field without any prefix. For example: For a custom property with name as GiftWrap, use search criteria field as GiftWrap.
-
queryFormat(optional): string
Should be SCIM if we are searching based on the SCIM filter
-
requireProfileDetail(optional): boolean
The flag indicating whether to fetch the profile detail.
-
siteScope(optional): string
Defines the scope of search when site id is passed. It takes the values - siteOnly or sharedCart. If siteScope is passed as siteOnly, it will return orders corresponding to a particular site. If it is passed as sharedCart, it will return all orders corresponding to Sharing sites in the Site Group. The default value is sharedCart
-
status(optional): string
state of the order eg. PENDING_PAYMENT
Header Parameters
-
X-CCOrganization(optional): string
the ID of the organization for which orders should be retrieved
-
X-CCSite(optional): string
the ID of the site for which orders should be retrieved.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : searchOrders_response
Type:
Show Source
object
-
orderHistory(optional):
array orderHistory
List of orders for the customer profile.
-
profileDetail(optional):
object profileDetail
The details of the customer profile
Nested Schema : profileDetail
Type:
object
The details of the customer profile
Show Source
-
dateOfBirth(optional):
string
Date of birth
-
daytimeTelephoneNumber(optional):
string
The day time telephone number of the customer profile.
-
email(optional):
string
Email of the customer profile.
-
firstName(optional):
string
The first name of the customer profile.
-
id(optional):
string
The customer profile id.
-
lastName(optional):
string
Last name of the customer profile.
-
locale(optional):
string
Current Locale
-
receiveEmail(optional):
string
Flag indicating whether the customer opted for receiving emails.
-
repositoryId(optional):
string
The repository id of the customer profile record.
-
shippingAddress(optional):
object shippingAddress
The default shipping address for the customer profile
Nested Schema : items
Type:
Show Source
object
-
cost(optional):
number
Shipping cost.
-
creationDate(optional):
string
Order creation date.
-
orderId(optional):
string
Order ID.
-
siteId(optional):
string
Site Id on which the Order was submitted.
-
state(optional):
string
Order state as key string.
-
stateDetailsAsUser(optional):
string
Current state of the order.
-
submittedDate(optional):
string
Date on which the Order was submitted.
-
subTotal(optional):
number
Total amount of order.
-
tax(optional):
number
Tax.
-
total(optional):
number
Total amount of order.
Nested Schema : shippingAddress
Type:
object
The default shipping address for the customer profile
Show Source
-
address1(optional):
string
The address line 1 in the shipping address.
-
address2(optional):
string
The address line 2 in the shipping address.
-
city(optional):
string
The city in the shipping address record.
-
country(optional):
string
The country in the shipping address record.
-
county(optional):
string
The county in the shipping address.
-
firstName(optional):
string
The first name in the shipping address.
-
lastName(optional):
string
The last name in the shipping address.
-
phoneNumber(optional):
string
The phone number in the shipping address.
-
postalCode(optional):
string
The postal code in the shipping address.
-
repositoryId(optional):
string
The repository id of the shipping address record.
-
state(optional):
string
The state in the shipping address.
Example Response (application/json)
{
"profileDetail":{
"lastName":"Butt",
"firstName":"James",
"customerContactId":"CRMID_1",
"repositoryId":"120099",
"receiveEmail":"no",
"shippingAddress":{
"lastName":"Butt",
"firstName":"James",
"country":"United States",
"phoneNumber":"504-845-1427",
"address2":"",
"city":"New Orleans",
"address1":"6649 N Blue Gum St",
"postalCode":"70116",
"county":"Orleans",
"repositoryId":"140010",
"state":"Los Angeles"
},
"dateOfBirth":"2000-11-14T00:00:00.000Z",
"id":"120099",
"locale":"en_US",
"email":"jbutt@gmail.com",
"daytimeTelephoneNumber":""
},
"orderHistory":[
{
"total":103.5,
"cost":6.5,
"orderId":"o20005",
"siteId":"siteUS",
"tax":0,
"cartName":"o20005",
"state":"INCOMPLETE",
"subTotal":97,
"creationDate":"2014-06-26T09:47:29.000Z",
"submittedDate":"2014-06-26T09:48:29.000Z",
"stateDetailsAsUser":"Incomplete"
},
{
"total":103.5,
"cost":6.5,
"orderId":"o20004",
"siteId":"siteUS",
"tax":0,
"cartName":"o20004",
"state":"INCOMPLETE",
"subTotal":97,
"creationDate":"2014-06-26T09:47:11.000Z",
"submittedDate":"2014-06-26T09:48:11.000Z",
"stateDetailsAsUser":"Incomplete"
}
]
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|22000|Profile Id passed is null or empty.|
|22001|Internal error occurred while processing the request.|
|22002|No profile found with profile id.
Below is the list of error codes specific to Text Search:
|Error Code|Description|
|------------------|------------------|
|100002|Invalid date format.|
|100006|Invalid boolean value.
|100013|Text search configuration is not enabled. Please enable text search to fetch the records.|
|200007|The offset passed is null or empty.|
|200008|The offset passed is not a number.|
|200009|The limit passed is null or empty.|
|200010|The limit passed is not a number|
|200011|Internal error occurred while retriving order history for the customer|
|300001|Internal error occurred while performing search operation|
|300002|One or more properties entered in the search criteria are invalid|
|300003|One or more properties entered in the search criteria are not accessible by the Agent user|
|300004|The property types of multiple dynamic properties entered in a single search criteria are not compatible with each other|
Below is the list of error codes specific to SCIM Search:
|Error Code|Description|
|------------------|------------------|
|85003|Invalid attribute in query
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code