Reports – order attribution
This method returns a list of orders that ECDP attributed to specific marketing messages within a selected date range.
Each record identifies the order, the customer, the channel and message that drove the conversion, and the order value in both the original and reporting currencies.
Use this method to audit attribution accuracy, reconcile revenue, and analyze campaign performance across email, SMS, and web push channels.
Endpoint
The server address for this request is https://api.ecdp.app/reports/attribution/orders
Request parameters
| Parameter | Location | Type | Required | Description | Allowed values / Notes |
| x-api-key | header | string | yes | API key for authentication | Available in Settings > API |
| startDate | query | string | yes | Start of the attribution reporting window | Format: YYYY-MM-DD. Must be a valid date |
| endDate | query | string | yes | End of the attribution reporting window | Format: YYYY-MM-DD. Must be a valid date. endDate must be later than startDate. |
| websiteId | query | integer | no | Limit results to a single website | Positive integer |
| channel | query | enum | no | Limit results to a single channel | Email, Sms, WebPush. Required when messageId is provided |
| messageType | query | enum | no | Limit results to a single message type | Newsletter, Scenario, Confirmation. Confirmation is available for Email only |
| messageId | query | integer | no | Limit results to orders attributed to a specific message | Positive integer. Requires channel |
| includeDetails | query | boolean | no | Include product line items for each order | True or false. Default: false |
Response
The response contains a data array. Each element represents one attributed order.
Order attribution report data
| Field | Type | Description |
| orderId | string | Unique order identifier |
| orderDateTime | string | Date and time the order was placed, in ISO-8601 UTC format. |
| websiteId | integer | Website the order originated from |
| channel | string | Channel that drove the attribution: Email, SMS, PopUp, WebPush, Banner, Mobile. |
| messageType | string | Type of message: Newsletter, Scenario, or Confirmation |
| messageId | integer | Identifier of the attributed message |
| customer | – | See Customer data |
Customer data
The customer data contains the following fields.
| Field | Type | Description |
| id | integer | ECDP internal customer ID |
| string | Customer email address | |
| phone | string | Customer phone number |
| crmId | string | Customer CRM identifier |
Order value and summary
| Field | Type | Description |
| orderValueConverted | number | Order value converted to the tenant’s reporting currency |
| originalTotalValue | number | Order value in the original transaction currency |
| originalCurrency | string | ISO 4217 currency code of the original transaction |
| productsCount | integer | Number of distinct product lines in the order |
Order attributes
orderAttributes is an array of { name, value } pairs carrying order-level custom attributes (for example, coupon codes or shipping methods). The field is omitted when no attributes are present.
Order details
When includeDetails=true, each order includes an orderDetails array of product line items.
| Field | Type | Description |
| id | string | Product identifier as provided by the e-commerce source |
| name | string | Product name |
| price | number | Unit price in the original transaction currency |
| quantity | number | Quantity purchased |
| returned | number | Quantity returned. Omitted if not applicable |
| category | string | Product category. Omitted if not set |
| productAttributes | array | Array of { name, value } pairs with product-level custom attributes. Omitted if none |
| recommendationAttribution | object | Present when the product was added via an ECDP recommendation. See structure below |
Recommendation attribution object
| Field | Type | Description |
| scope | string | Attribution scope: Channel or Onsite |
| type | string | Recommender type label |
| id | integer | Recommender identifier (for example, banner ID) |
| channel | string | Recommendation surface: Banner, Email, or PopUp |
Response codes
| Code | Status | Description |
| 200 | OK | Request processed successfully. Response contains the attributed orders list |
| 204 | No content | Request is valid but no orders match the specified criteria |
| 400 | Bad request | Invalid or missing parameters |
| 401 | Unauthorized | API key is missing, invalid, or expired |
| 403 | Forbidden | API key does not have permission to access this resource |
| 500 | Internal server error | Server-side error. Retry the request or contact support if the issue persists |
Example requests and responses
Get summary report for a specific website and channel
GET /reports/attribution/orders?startDate=2025-03-01&endDate=2025-03-07&websiteId=21&channel=Email
Response (200 OK):
{
"data": [
{
"orderId": "100042",
"orderDateTime": "2025-03-03T11:24:15Z",
"websiteId": 21,
"channel": "Email",
"messageType": "Newsletter",
"messageId": 12045,
"customer": { "id": 981245, "email": "jane@example.com", "phone": "", "crmId": "778" },
"orderValueConverted": 249.50,
"originalTotalValue": 249.50,
"originalCurrency": "USD",
"productsCount": 3
},
{
"orderId": "100057",
"orderDateTime": "2025-03-05T19:02:41Z",
"websiteId": 21,
"channel": "Email",
"messageType": "Scenario",
"messageId": 11880,
"customer": { "id": 771100, "email": "bob@example.com", "phone": "", "crmId": "101" },
"orderValueConverted": 89.99,
"originalTotalValue": 89.99,
"originalCurrency": "USD",
"productsCount": 1
}
]
}Get report filtered by message with product line items
GET /reports/attribution/orders?startDate=2025-03-15&endDate=2025-03-15&channel=WebPush&messageType=Newsletter&messageId=9021&websiteId=21&includeDetails=true
Response (200 OK):
{
"data": [
{
"orderId": "100042",
"orderDateTime": "2025-03-15T09:41:06Z",
"websiteId": 21,
"channel": "WebPush",
"messageType": "Newsletter",
"messageId": 9021,
"customer": { "id": 332100, "email": "", "phone": "", "crmId": "551" },
"orderValueConverted": 142.70,
"originalTotalValue": 142.70,
"originalCurrency": "USD",
"productsCount": 2,
"orderAttributes": [
{ "name": "coupon", "value": "SPRING10" }
],
"orderDetails": [
{
"id": "SKU-101",
"name": "Canvas Tote",
"price": 39.90,
"quantity": 1,
"category": "Bags",
"productAttributes": [{ "name": "color", "value": "natural" }]
},
{
"id": "SKU-225",
"name": "Water Bottle",
"price": 102.80,
"quantity": 1,
"returned": 1,
"category": "Accessories",
"recommendationAttribution": {
"scope": "Onsite",
"type": "Bestsellers",
"id": 12,
"channel": "Banner"
}
}
]
}
]
}Validation and behavior rules#
- startDate and endDate are required. startDate must be earlier than or equal to endDate.
- channel is required when messageId is provided.
- messageType value Confirmation is valid only when channel=Email.
- Each filter parameter accepts exactly one value. Repeating the same parameter or passing an empty value returns ‘400 Bad Request’.
- includeDetails accepts true or false only. Any other value returns ‘400 Bad Request’.
- When no orders match the query, the endpoint returns ‘204 No Content’.
Reference documentation#
Swagger – Reports attribution