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:
integerRequired:trueThe batch size of the order records to be fetched together.- offset
Type:integerRequired:trueThe start index of the list of order records to be fetched.- profileId
Type:stringRequired:trueThe customer profile id.- q
Type:stringSearch 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:stringShould be SCIM if we are searching based on the SCIM filter- requireProfileDetail
Type:booleanThe flag indicating whether to fetch the profile detail.- status
Type:stringstate of the order eg. PENDING_PAYMENTHeader Parameters- X-CCOrganization
-
Type:
stringthe organization Id in which order should be created- X-CCSite
Type:stringthe 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:
arrayorderHistoryAdditional Properties Allowed:List of orders for the customer profile. - profileDetail
-
Type:
objectprofileDetailAdditional Properties Allowed:The details of the customer profile
Nested Schema : orderHistoryNested Schema : profileDetailType:objectThe details of the customer profile- daytimeTelephoneNumber
-
Type:
stringThe day time telephone number of the customer profile. -
Type:
stringEmail of the customer profile. - firstName
-
Type:
stringThe first name of the customer profile. - id
-
Type:
stringThe customer profile id. - lastName
-
Type:
stringLast name of the customer profile. - receiveEmail
-
Type:
stringFlag indicating whether the customer opted for receiving emails. - repositoryId
-
Type:
stringThe repository id of the customer profile record. - shippingAddress
-
Type:
objectshippingAddressAdditional Properties Allowed:The default shipping address for the customer profile
Nested Schema : itemsType:object- cost
-
Type:
numberShipping cost. - creationDate
-
Type:
stringOrder creation date. - orderId
-
Type:
stringOrder ID. - siteId
-
Type:
stringSite Id on which the Order was submitted. - state
-
Type:
stringOrder state as key string. - stateDetailsAsUser
-
Type:
stringCurrent state of the order. - submittedDate
-
Type:
stringDate on which the Order was submitted. - subTotal
-
Type:
numberTotal amount of order. - tax
-
Type:
numberTax. - total
-
Type:
numberTotal amount of order.
Nested Schema : shippingAddressType:objectThe default shipping address for the customer profile- address1
-
Type:
stringThe address line 1 in the shipping address. - address2
-
Type:
stringThe address line 2 in the shipping address. - city
-
Type:
stringThe city in the shipping address record. - country
-
Type:
stringThe country in the shipping address record. - county
-
Type:
stringThe county in the shipping address. - firstName
-
Type:
stringThe first name in the shipping address. - lastName
-
Type:
stringThe last name in the shipping address. - phoneNumber
-
Type:
stringThe phone number in the shipping address. - postalCode
-
Type:
stringThe postal code in the shipping address. - repositoryId
-
Type:
stringThe repository id of the shipping address record. - state
-
Type:
stringThe 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:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - errors
-
Type:
arrayerrorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code - type
-
Type:
stringThe URI to the HTTP state code definition
Nested Schema : errorsNested Schema : itemsType:object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe 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" } ] }