Creates an order data extension.
To avoid creating key-value pairs that already exist in the data extension for an order, first retrieve all the data extensions for an order to check that the keys you intend to create are unique.
In the request body, you must provide one object. This object represents the data extension. Note the following about the object:
- Can contain primitive values only. You cannot nest objects. If you need to group key-value pairs, use prefixes for the key names.
- Can contain a maximum of 100 key-value pairs.
- The key-value pairs you include in the object become the extension data. For example, if you include
"firstTimeOrder": truein the object, First Time Order with the value oftruebecomes extension data. - Supported data types for the values:
- string, for example
"level2" - boolean, for example
true - integer, for example
9 - floating-point number, for example
99.9
- string, for example
The keys you enter in the request body must be:
- Alphanumeric [A-Z,a-z,0-9] as per the JSON RFC 7159 specification.
- In camel case.
Here's an example request body:
{
"firstTimeOrder": true,
"storeLocation": "London",
"totalUnits": 8,
"totalDiscount": "20%"
}This creates four key-value pairs for the order.
A key-value pair of your choice. Supported data types for the values: string, boolean, integer, floating-point number. Example: "firstTimeOrder": true
- Production server APhttps://api-engage-ap.sitecorecloud.io/v2.1/orders/{orderRef}/extensions/{dataExtensionName}
- Production server EUhttps://api-engage-eu.sitecorecloud.io/v2.1/orders/{orderRef}/extensions/{dataExtensionName}
- Production server JPhttps://api-engage-jpe.sitecorecloud.io/v2.1/orders/{orderRef}/extensions/{dataExtensionName}
- Production server UShttps://api-engage-us.sitecorecloud.io/v2.1/orders/{orderRef}/extensions/{dataExtensionName}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u '<username>:<password>' \
https://api-engage-ap.sitecorecloud.io/v2.1/orders/2d7de9df-45a2-45ea-872c-30e45139007d/extensions/ext \
-H 'Content-Type: application/json' \
-d '{
"{exampleKey1}": "{exampleValue1}",
"{exampleKey2}": "{exampleValue2}"
}'Resource successfully created
The URL of the order extension.
The date and time when the resource was created in Sitecore CDP.
The date and time when the resource was last updated in Sitecore CDP.
A key-value pair of your choice. Supported data types for the values: string, boolean, integer, floating-point number. Example: "firstTimeOrder": true
A key-value pair of your choice. Supported data types for the values: string, boolean, integer, floating-point number. Example:"storeLocation": "London"
{ "name": "ext", "href": "https://api-engage-eu.sitecorecloud.io/v2.1/orders/f7aabbca-1c1b-4fc2-be72-3e16294a4f03/extensions/ext", "ref": "6a5cb3c2-1a4a-56d8-8a01-1ede232b9db2", "key": "default", "createdAt": "2024-01-01T16:17:16Z", "modifiedAt": "2024-01-01T16:17:16Z", "{exampleKey1}": "{exampleValue1}", "{exampleKey2}": "{exampleValue2}", "order": { "href": "https://api-engage-eu.sitecorecloud.io/v2.1/orders?guestRef=2d7de9df-45a2-45ea-872c-30e45139007d&offset=1&limit=10" } }