Skip to main content

Using the retrieve order consumer function in Sitecore CDP REST API

Abstract

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

You can use the Order Consumer REST API to perform the retrieve order consumers function to retrieve the consumer(s) associated with the order item. To do this, you need the orderConsumerRef returned when you locate order consumers

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

GET: https://apiEndpoint/v2/orderConsumers/orderConsumerRef

Attribute

Description

Type

orderConsumerRef

The reference of the consumer on the order.

string

$ curl -H "Accept: application/json" \
        "http://{apiEndpoint}/v2/orderConsumers/C439E8B9-53F3-48BB-BD98-EE3657416FBE"

The following is a 200 response:

{
    "href": "http://{apiEndpoint}/v2/orderConsumers/C439E8B9-53F3-48BB-BD98-EE3657416FBE",
    "ref": "C439E8B9-53F3-48BB-BD98-EE3657416FBE",
    "createdAt": "2014-08-15T16:00:55.554Z",
    "modifiedAt": "2014-08-21T16:00:51.882Z",
    "title": "Mr",
    "firstName": "Tom",
    "lastName": "Smith",
    "gender": "male",
    "guest": {
        "href": "http://{apiEndpoint}/v2/guests/567A697E-4E79-4F2C-96D1-A7249A44744F"
    },
    "orderItems": {
        "items": [{
                "href": "http://{apiEndpoint}/v2/orderItems/FECBB7ED-6DFE-4E8C-85A9-B894B17EF4F3"
            }]
    },
    "order": {
       "href": "http://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE"
    }
}