Skip to main content

Using the locate order consumer function in Sitecore CDP REST API

Abstract

Provides a cURL command to locate order consumers in Sitecore CDP REST API (Data model 2.0).

You can use the Order Consumer REST API to perform the locate order consumers function to return the consumer associated with the order item. The response returns the referenceIds of the order item(s) which you can then use when you retrieve an order consumer.

To locate order consumer(s) in the Sitecore CDP, use the following:

GET: https://apiEndpoint/v2/orders/orderRef/consumers

Attribute

Description

Type

orderRef

The reference of the order.

string

$ curl -H "Accept: application/json" \
        "https://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE/consumers"

The following is a 200 response:

{
    "href": "https://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE/consumers",
    "items" : [{
        "href": "https://{apiEndpoint}/v2/orderConsumers/C439E8B9-53F3-48BB-BD98-EE3657416FBE"
    }]
}

You can use the reference.id in your search parameters.