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
-
Type:
integer
Required:true
The batch size of the order records to be fetched together.- offset
Type:integer
Required:true
The start index of the list of order records to be fetched.- profileId
Type:string
Required:true
The customer profile id.- q
Type: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| |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
Type:string
Should be SCIM if we are searching based on the SCIM filter- requireProfileDetail
Type:boolean
The flag indicating whether to fetch the profile detail.- status
Type:string
state of the order eg. PENDING_PAYMENTHeader Parameters- X-CCOrganization
-
Type:
string
the organization Id in which order should be created- X-CCSite
Type:string
the site Id in which order should be retrieved
Response
Supported Media Types- application/json
200 ResponseFollowing model is returned when operation succeeds.BodyRoot Schema : searchOrders_response- orderHistory
-
Type:
array
orderHistoryAdditional Properties Allowed:List of orders for the customer profile. - profileDetail
-
Type:
object
profileDetailAdditional Properties Allowed:The details of the customer profile
Nested Schema : orderHistoryNested Schema : profileDetailType:object
The details of the customer profile- daytimeTelephoneNumber
-
Type:
string
The day time telephone number of the customer profile. -
Type:
string
Email of the customer profile. - firstName
-
Type:
string
The first name of the customer profile. - id
-
Type:
string
The customer profile id. - lastName
-
Type:
string
Last name of the customer profile. - receiveEmail
-
Type:
string
Flag indicating whether the customer opted for receiving emails. - repositoryId
-
Type:
string
The repository id of the customer profile record. - shippingAddress
-
Type:
object
shippingAddressAdditional Properties Allowed:The default shipping address for the customer profile
Nested Schema : itemsType:object
- cost
-
Type:
number
Shipping cost. - creationDate
-
Type:
string
Order creation date. - orderId
-
Type:
string
Order ID. - siteId
-
Type:
string
Site Id on which the Order was submitted. - state
-
Type:
string
Order state as key string. - stateDetailsAsUser
-
Type:
string
Current state of the order. - submittedDate
-
Type:
string
Date on which the Order was submitted. - subTotal
-
Type:
number
Total amount of order. - tax
-
Type:
number
Tax. - total
-
Type:
number
Total amount of order.
Nested Schema : shippingAddressType:object
The default shipping address for the customer profile- address1
-
Type:
string
The address line 1 in the shipping address. - address2
-
Type:
string
The address line 2 in the shipping address. - city
-
Type:
string
The city in the shipping address record. - country
-
Type:
string
The country in the shipping address record. - county
-
Type:
string
The county in the shipping address. - firstName
-
Type:
string
The first name in the shipping address. - lastName
-
Type:
string
The last name in the shipping address. - phoneNumber
-
Type:
string
The phone number in the shipping address. - postalCode
-
Type:
string
The postal code in the shipping address. - repositoryId
-
Type:
string
The repository id of the shipping address record. - state
-
Type:
string
The state in the shipping address.
Example application/json
{ "profileDetail":{ "lastName":"Butt", "firstName":"James", "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" }, "id":"120099", "email":"jbutt@gmail.com", "daytimeTelephoneNumber":"" }, "orderHistory":[ { "total":103.5, "cost":6.5, "orderId":"o20005", "siteId":"siteUS", "tax":0, "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, "state":"INCOMPLETE", "subTotal":97, "creationDate":"2014-06-26T09:47:11.000Z", "submittedDate":"2014-06-26T09:48:11.000Z", "stateDetailsAsUser":"Incomplete" } ] }
Default ResponseThe 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 occured 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 Below is the list of error codes specific to SCIM Search: |Error Code|Description| |------------------|------------------| |85003|Invalid attribute in queryBodyRoot Schema : errorModelType:object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errorsNested Schema : itemsType:object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code
Examples
Sample Response Payload returned by endpoint:
{ "profileDetail": { "lastName": "Butt", "firstName": "James", "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" }, "id": "120099", "email": "jbutt@gmail.com", "daytimeTelephoneNumber": "" }, "orderHistory": [ { "total": 103.5, "cost": 6.5, "orderId": "o20005", "siteId": "siteUS", "tax": 0, "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, "state": "INCOMPLETE", "subTotal": 97, "creationDate": "2014-06-26T09:47:11.000Z", "submittedDate": "2014-06-26T09:48:11.000Z", "stateDetailsAsUser": "Incomplete" } ] }