Sending orders
Managing orders in real-time
Use the Stream API to collect and send order data in real-time to Sitecore CDP, including when an order is created. There are several order-related events you can send as a guest interacts with your site. For example, when a guest adds a product to their shopping cart, makes a purchase, or empties their shopping cart.
To capture data in JavaScript or TypeScript web applications, we recommend that you use the Cloud SDK or the Engage SDK. These SDKs use the Stream API behind the scenes and let you easily capture data in your web app. Use the Cloud SDK if you have a JSS Next.js or JSS Angular application connected to XM Cloud. Use the Engage SDK in other JavaScript applications.
All order and order item information is captured and is visible in the guest profile.
To ensure that the order is created, you must send the required events, in the correct order, and model the event object based on one of the following integration options:
-
If your organization is using the Engage SDK to integrate, see sending orders for details on the events that are required to create an order. This is the preferred method for sending orders to Sitecore CDP.
-
If your organization is not using the Engage SDK to integrate, see sending orders for details on the events that are required to create an order.
You cannot update or delete an order using the Stream API. To do this, use the Batch API or REST API.
Managing orders synchronously
Use the REST APIs to synchronously create and update orders, order items, order contacts, and order consumers in Sitecore CDP. To ensure that you can view the order data in guest profiles and access it in batch segmentation and audience exports, you must model the order data object and the other data objects for the REST API.
Offline order submission
Use the Batch API to create, update and delete offline orders. You can use offline order submission with the Batch API to do any of the following:
-
Submit a large amount of historical orders from a data lake or data warehouse as a once-off, when your organization first integrates with Sitecore CDP.
-
Submit offline orders from a third-party system, such as a call center.
-
Submit orders for guests who block cookies or who use an anonymous browser.
-
Submit complete orders if your organization submits partial orders using the Stream API.
-
Update orders submitted with the Stream API on a daily basis.
To ensure the order data is available in the Sitecore CDP UI, you must follow the Batch API guidelines for the order data model and the order item data model.
Sending additional order and order item data using data extensions
The Batch API and the REST API let you send additional order and order item data to Sitecore CDP that isn't part of the order and order item data model.
You can send additional data using a data extension. A data extension is an array that enables you to specify whatever key-value pairs (attributes) your organization wants. This lets your organization capture more robust information about the order or order item.
You can send additional data using an order data extension or an order item data extension in one of two ways:
-
If you use the Batch API, follow the Batch API guidelines for sending additional order data and sending additional order item data. Make sure to format the data according to the order extension data model and the order item extension data model.
-
If you use the REST API, create an order or order item data extension.
After capturing additional order or order item data using a data extension, the data becomes available in Sitecore CDP. You can:
-
View the order and order item data extension associated with a guest in the guest profile, on the Orders tab.
-
Use the order and order item data extensions in batch segmentation. See also an example of how order and order item data extensions display in batch segmentation.
-
Include the extension data in audience exports.