Skip to main content
Users
CloudPortalLogin
  • Powered byPowered by
Developing with Sitecore CDP
Data privacy
Before you start sending data
Integrating with Sitecore CDP
Stream API
Batch API
REST APIs
Data lake export service
  • Sitecore CDP for developers
  • Batch API
  • Batch API Offline orders
  • Order delete data model

Order delete data model

The Order Delete API uses a combination of the referenceId and orderedAt values to delete an order. This is because some organizations recycle referenceId values, so supplying the orderedAt value as well ensures you are identifying the correct order for deletion. Sitecore CDP identifies an order for deletion if the orderedAt value is within 24 hours of the orderedAt value sent in the request and the referenceId values are the same.

In rare circumstances, you must also use the orderRef attribute in the request to identify the correct order for deletion. You only need to do this if the order you want to delete has an orderedAt value that's within 24 hours of another order, and both orders have the same referenceId value. For example, you want to delete an order with an orderedAt value of "2023-09-25T16:17:16.000Z" and there's another order with an orderedAt value of "2023-09-25T20:47:55.000Z". If both orders have the same referenceId value of "B94TXY-1", you must also use the orderRef attribute in the request, as shown in the second JSON example.

To obtain the orderRef value, you can use debug mode to view the JSON of the guest profile and copy the ref value from the orders object. Alternatively, you can use the data lake export service to obtain the meta_ref value which is the same as the orderRef value. You can also use Audience Export to obtain the orderRef value.

When you create a batch file, ensure that you include all required attributes in addition to any attributes from the following table:

Attribute

Description

Type

Example(s)

ref

A unique ID that identifies the JSON record during the upload process. This ID is not used inside Sitecore CDP to identify the guest or the record; it is for the upload process only.

string

Version 4 UUID

"056621C2-C955-492D-B7EE-C77C6BDDFDEE"

schema

The type of record contained in the value field that is being imported. This must be set to "order" when deleting orders..

string

"order"

mode

The Batch API mode. This must be set to "delete".

string

"delete"

value

Contains the entity to be deleted from Sitecore CDP.

JSON object

N/A

orderRef

A unique ID generated by Sitecore CDP to reference the order.

string

"1202a558-5de3-46fc-8e45-eac7420f8c55"

referenceId

A unique ID generated by your organization to reference the order.

string

"B94TXY-1"

orderedAt

The date and time the order was made.

ISO 8601 Date/Time UTC

"2025-03-07T16:15:11.000Z"

Here's a JSON example that uses the "referenceId" and "orderedAt" attributes to delete an order:

RequestResponse
{
   "ref":"056621C2-C955-492D-B7EE-C77C6BDDFDEE",
   "schema":"order",
   "mode":"delete",
   "value":{
      "referenceId":"B94TXY-1",
      "orderedAt":"2025-03-07T16:15:11.000Z"
   }
}

Here's a JSON example that uses the "orderRef", "referenceId", and "orderedAt" attributes to delete an order:

RequestResponse
{
   "ref":"056621C2-C955-492D-B7EE-C77C6BDDFDEE",
   "schema":"order",
   "mode":"delete",
   "value":{
      "orderRef":"1202a558-5de3-46fc-8e45-eac7420f8c55",
      "referenceId":"B94TXY-1",
      "orderedAt":"2025-03-07T16:15:11.000Z"
   }
}

Do you have some feedback for us?

If you have suggestions for improving this article,

Privacy policySitecore Trust CenterCopyright © 1999-2026 Sitecore