Skip to main content

Using the update order item function in Sitecore CDP REST API

Abstract

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

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

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

POST: https://apiEndpoint/v2/orderItems/orderItemRef

Attribute

Description

Type

orderItemRef

The reference of the order item.

string

$curl  --request POST 'https://{apiEndpoint}/v2/orderItems/7737242c-1ec4-4644-b4be-ca8a3882fba9' \
--header 'Content-Type: application/json'  \
--data-raw '{
    "type": "FLIGHT",
    "productId": "DUB-LAS",
    "orderedAt": "2016-07-23T16:17:16.000Z",
    "quantity": 1,
    "price": 100.00,
    "currencyCode": "EUR",
    "originalPrice": 112.00,
    "originalCurrencyCode": "USD",
    "referenceId": "B94TXY",
    "status": "PURCHASED",
    "passengerTypeCode": "ADT",
    "flightSegments": [{
        "id": "1234",
        "origin": "DUB",
        "destination": "LHR",
        "originDestination": "DUB-LHR",
        "departureDateTime": "2016-08-15T16:00:00.000Z",
        "arrivalDateTime": "2016-08-15T17:30:00.000Z",
        "fareClass": "Economy",
        "fareFamily": "Plus",
        "bookingClass": "Y",
        "carrier": "BX",
        "flightNumber": "459",
        "operatingCarrier": "BX",
        "operatingFlightNumber": "1459" 
    },
    {
        "id": "1235",
        "origin": "LHR",
        "destination": "LAS",
        "originDestination": "DUB-LAS",
        "departureDateTime": "2016-08-15T19:00:00.000Z",
        "arrivalDateTime": "2016-08-15T21:30:00.000Z",
        "fareClass": "Economy",
        "fareFamily": "Plus",
        "bookingClass": "Y",
        "carrier": "BX",
        "flightNumber": "460",
        "operatingCarrier": "BX",
        "operatingFlightNumber": "1460"
    }]
}' 

The following is a 200 response:

{
    "type": "FLIGHT",
    "href": "https://{apiEndpoint}/v2/orderItems/8d5ed649-337b-4b3f-9697-9d06cadd7fd9",
    "ref": "8d5ed649-337b-4b3f-9697-9d06cadd7fd9",
    "order": {
        "href": "https://{apiEndpoint}/v2/orders/25875e50-f984-4f10-8974-673e62a248cb"
    },
    "createdAt": "2017-09-11T07:49:21.239Z",
    "modifiedAt": "2017-11-08T16:20:30.503Z",
    "orderedAt": "2016-07-23T16:17:16.000Z",
    "productId": "DUB-LAS",
    "price": 100,
    "currencyCode": "EUR",
    "originalPrice": 112,
    "originalCurrencyCode": "USD",
    "referenceId": "B94TXY",
    "vendor": "unknown",
    "status": "PURCHASED",
    "language": "EN",
    "name": "Flight DUB-LAS",
    "description": "Flight DUB-LAS",
    "quantity": 1,
    "channel": "WEB",
    "flightSegments": [
        {
            "id": "1234",
            "origin": "DUB",
            "destination": "LHR",
            "departureDateTime": "2016-08-15T16:00:00.000Z",
            "arrivalDateTime": "2016-08-15T17:30:00.000Z",
            "flightNumber": "459",
            "fareClass": "Economy",
            "fareFamily": "Plus",
            "carrier": "BX",
            "originDestination": "DUB-LHR",
            "bookingClass": "Y",
            "operatingCarrier": "BX"
        },
        {
            "id": "1235",
            "origin": "LHR",
            "destination": "LAS",
            "departureDateTime": "2016-08-15T19:00:00.000Z",
            "arrivalDateTime": "2016-08-15T21:30:00.000Z",
            "flightNumber": "460",
            "fareClass": "Economy",
            "fareFamily": "Plus",
            "carrier": "BX",
            "originDestination": "DUB-LAS",
            "bookingClass": "Y",
            "operatingCarrier": "BX"
        }
    ],
    "passengerTypeCode": "ADT",
    "consumerTypeCode": "ADT",
    "sku": "DUB-LAS"
}