Skip to main content

Using the retrieve order function in Sitecore CDP REST API

Abstract

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

You can use the Order REST API to perform the retrieve order function to retrieve the order as well as additional attributes contained in the declared order entity. To do this, you need the orderRef attribute from when you locate orders.

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

GET: https://apiEndpoint/v2/orders/orderRef

Attribute

Description

Type

orderRef

The order reference number.

string

$ curl -H "Accept: application/json" \
     "https://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE"

The following is a 200 response:

{
    "href": "https://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE",
    "ref": "056621C2-C955-492D-B7EE-C77C6BDDFDEE",
    "createdAt": "2014-08-15T16:00:55.554Z",
    "modifiedAt": "2014-08-21T16:00:51.882Z",
    "orderedAt": "2014-08-15T16:00:55.554Z",
    "price": 100.00,
    "currencyCode": "EUR",
    "referenceId": "B94TXY",
    "paymentType": "Card",
    "cardType": "Visa",
    "pointOfSale": "default",
    "channel": "WEB",
    "status": "PURCHASED",
    "contacts": {
        "href": "https://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE/contacts"
    },
    "consumers": {
        "href": "https://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE/consumers"
    },
    "orderItems": {
        "href": "https://{apiEndpoint}/v2/orders/056621C2-C955-492D-B7EE-C77C6BDDFDEE/orderItems"
    }
}