Skip to content

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

ParameterLocationTypeRequiredDescriptionAllowed values / Notes
x-api-keyheaderstringyesAPI key for authenticationAvailable in Settings > API
startDatequery  stringyesStart of the attribution reporting windowFormat: YYYY-MM-DD. Must be a valid date
endDatequerystringyesEnd of the attribution reporting windowFormat: YYYY-MM-DD. Must be a valid date. endDate must be later than startDate.
websiteIdqueryintegernoLimit results to a single websitePositive integer
channelqueryenumnoLimit results to a single channelEmail, Sms, WebPush. Required when messageId is provided
messageTypequeryenumnoLimit results to a single message typeNewsletter, Scenario, Confirmation. Confirmation is available for Email only
messageIdqueryintegernoLimit results to orders attributed to a specific messagePositive integer. Requires channel
includeDetailsquerybooleannoInclude product line items for each orderTrue or false. Default: false

Response

The response contains a data array. Each element represents one attributed order.

Order attribution report data

FieldTypeDescription
orderIdstringUnique order identifier
orderDateTimestringDate and time the order was placed, in ISO-8601 UTC format.
websiteIdintegerWebsite the order originated from
channelstringChannel that drove the attribution: Email, SMS, PopUp, WebPush, Banner, Mobile.
messageTypestringType of message: Newsletter, Scenario, or Confirmation
messageIdintegerIdentifier of the attributed message
customerSee Customer data

Customer data

The customer data contains the following fields.

FieldTypeDescription
idintegerECDP internal customer ID
emailstringCustomer email address
phonestringCustomer phone number
crmIdstringCustomer CRM identifier

Order value and summary

FieldTypeDescription
orderValueConvertednumberOrder value converted to the tenant’s reporting currency
originalTotalValuenumberOrder value in the original transaction currency
originalCurrencystringISO 4217 currency code of the original transaction
productsCountintegerNumber 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.

FieldTypeDescription
idstringProduct identifier as provided by the e-commerce source
namestringProduct name
pricenumberUnit price in the original transaction currency
quantitynumberQuantity purchased
returnednumberQuantity returned. Omitted if not applicable
categorystringProduct category. Omitted if not set
productAttributesarrayArray of { name, value } pairs with product-level custom attributes. Omitted if none
recommendationAttributionobjectPresent when the product was added via an ECDP recommendation. See structure below

Recommendation attribution object

FieldTypeDescription
scopestringAttribution scope: Channel or Onsite
typestringRecommender type label
idintegerRecommender identifier (for example, banner ID)
channelstringRecommendation surface: Banner, Email, or PopUp

Response codes

CodeStatusDescription
200OKRequest processed successfully. Response contains the attributed orders list
204No contentRequest is valid but no orders match the specified criteria
400Bad requestInvalid or missing parameters
401UnauthorizedAPI key is missing, invalid, or expired
403ForbiddenAPI key does not have permission to access this resource
500Internal server errorServer-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

https://api.ecdp.app/swagger/index.html