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
Query Parameters
  • The batch size of the order records to be fetched together.
  • The start index of the list of order records to be fetched.
  • The customer profile id.
  • 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.
  • Should be SCIM if we are searching based on the SCIM filter
  • The flag indicating whether to fetch the profile detail.
  • state of the order eg. PENDING_PAYMENT
Header Parameters
Back to Top

Response

Supported Media Types

200 Response

Following model is returned when operation succeeds.
Body ()
Root Schema : searchOrders_response
Type: object
Show Source
Nested Schema : orderHistory
Type: array
List of orders for the customer profile.
Show Source
Nested Schema : profileDetail
Type: object
The details of the customer profile
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : shippingAddress
Type: object
The default shipping address for the customer profile
Show Source
Example Response (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"
        },
        "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
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top