Using the update order contact function in Sitecore CDP REST API

Abstract

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

You can use the Order Contact REST API to perform the update order contact function to update the attributes of a contact of an order item.

To update an order contact in the Sitecore CDP, use the following:

POST: https://apiEndpoint/v2/orderContacts/orderContactRef

Attribute

Description

Type

orderContactRef

The reference of the contact on the order.

string

$curl  --request POST 'https://{apiEndpoint}/v2/orderContacts/F8D1F0D5-365D-46B7-BECF-D041E93A5705' \
--header 'Content-Type: application/json'  \
--data-raw '{
    "title": "Mr",
    "firstName": "Jack",
    "lastName": "Smith",
    "gender": "male",
    "dateOfBirth": "1976-10-28T00:00:00.000Z",
    "emails": [
        "jack.smith@boxever.com"
    ],
    "phoneNumbers": [
        "+353161123345",
        "+353861123345"
    ],
    "nationality": "Irish",
    "passportNumber": "PZ4A9565",
    "guest": {
        "href": "https://{apiEndpoint}/v2/guests/9d94ee11-7043-4b71-980c-a777d00a7b46"
    }
}' 

The following is a 200 response:

{
  "href": "https://{apiEndpoint}/v2/orderContacts/F8D1F0D5-365D-46B7-BECF-D041E93A5705",
  "ref": "F8D1F0D5-365D-46B7-BECF-D041E93A5705",
  "createdAt": "2014-08-15T16:00:55.554Z",
  "modifiedAt": "2014-08-21T16:00:51.882Z",
  "title": "Mr",
  "firstName": "Jack",
  "lastName": "Smith",
  "gender": "male",
  "dateOfBirth": "1976-10-28T00:00:00.000Z",
  "emails": [
      "jack.smith@boxever.com"
  ],
  "phoneNumbers": [
      "+353161123345",
      "+353861123345"
  ],
  "nationality": "Irish",
  "passportNumber": "PZ4A9565",
  "guest": {
    "href": "https://{apiEndpoint}/v2/guests/9d94ee11-7043-4b71-980c-a777d00a7b46"
  },
  "order": {
    "href": "https://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE"
  }
}