Using the update order consumer function in Sitecore CDP REST API

Abstract

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

You can use the Order Consumer REST API to perform the update order consumers function to update the attributes of a consumer of an order item.

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

POST: https://apiEndpoint/v2/orderConsumers/orderConsumerRef

Attribute

Description

Type

orderConsumerRef

The reference of the consumer on the order.

string

$curl  --request POST 'https://{apiEndpoint}/v2/orderConsumers/F8D1F0D5-365D-46B7-BECF-D041E93A5705' \
--header 'Content-Type: application/json'  \
--data-raw '{
    "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"
         }]
    }
}' 

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