Using the retrieve order item function in Sitecore CDP REST API

Abstract

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

You can use the Order REST API to perform a retrieve order item function to retrieve the attributes of an order item. To do this, you need the orderItemRef returned by using the locate order items function.

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

GET: https://apiEndpoint/v2/orderItems/orderItemRef

Attribute

Description

Type

orderItemRef

The reference of the order item.

string

$ curl -H "Accept: application/json" \
     "https://{apiEndpoint}/v2/orderItems/FECBB7ED-6DFE-4E8C-85A9-B894B17EF4F3"

The following is a 200 response:

{
    "href": "https://{apiEndpoint}/v2/orderItems/FECBB7ED-6DFE-4E8C-85A9-B894B17EF4F3",
    "ref": "FECBB7ED-6DFE-4E8C-85A9-B894B17EF4F3",
    "createdAt": "2016-07-10T18:20:55.554Z",
    "modifiedAt": "2016-08-21T16:00:51.882Z",
    "type": "FLIGHT",
    "productId": "DUB-LAS",
    "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": "LHR-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"
    }],
    "order" : {
        "href": "https://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE"
    }
}