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_PAYMENT
Header 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 Response
Following model is returned when operation succeeds.
Body
Root Schema : searchOrders_response
Nested Schema : orderHistory
Type: array
List of orders for the customer profile.
Nested Schema : profileDetail
Type: object
The details of the customer profile
Nested Schema : items
Type: object
Nested Schema : shippingAddress
Type: object
The default shipping address for the customer profile
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 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 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 query
Body
Root Schema : errorModel
Type: object
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Nested Schema : items
Type: object

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"
    }
  ]
}