Skip to content

Orders 

Order API methods let e-commerce platforms sync order data with ECDP. This keeps customer purchase history up to date and supports analytics, segmentation, RFM analysis, and personalized marketing workflows.

POST/orders – add or update orders

creates new orders or updates existing order records.

Endpoint

The endpoint for GET requests is https://api.ecdp.app/orders

Request parameters

ParameterLocationTypeRequiredDescriptionAllowed values / Notes
x-api-keyheaderstringyesAPI authentication keyObtain from Settings > API
Content-TypeheaderStringyesRequest content typeApplication/json
modebodystringyesOperation modeAdd, AddOrReplace, Replace
idbodystringyesUnique order identifierMax: 128 characters
datebodystringyesOrder placement timestampISO 8601 format: YYYY-MM-DDT HH:mm:ss.sssZ
timeZonebodystringnoTime zone for order dateSee Supported time zones. Default: business unit time zone
websiteIdbodyintegerNoWebsite identifierInteger value
statusbodystringnoOrder statusplaced, paid, completed, canceled
currencybodystringnoCurrency codeExactly 3 characters (ISO 4217)
totalValuebodynumbernoTotal order valueMin: 0
returnsValuebodynumbernoValue of returned itemsMin: 0
customerbodyobjectyesCustomer identificationSee Order customer data
productsbodyarrayyesOrdered productsSee Order product data
orderAttributesbodyarraynoCustom order attributesSee Order attribute value

Order customer data

ParameterLocationTypeRequiredDescriptionNotes
emailbodystringconditionalCustomer email addressRequired if email is the default matching mode. Max: 320 characters
phonebodystringconditionalCustomer phone numberRequired if phone is the default matching mode. Max: 20 characters
crmIdbodystringconditionalCustomer CRM identifierRequired if CRM ID is the default matching mode. Max: 128 characters

At least one customer identifier matching your Settings > Customers > Customers configuration is required.

Order product data

ParameterLocationTypeRequiredDescriptionNotes
idbodystringyesProduct identifierMin: 1, Max: 128 characters
namebodystringyesProduct nameMin: 0, Max: 2048 characters
pricebodynumberyesUnit priceMin: 0
quantitybodyintegeryesQuantity purchasedMin: 1, Max: 2147483647
returnedbodyintegernoQuantity returnedMin: 0, Max: 2147483647
urlbodystringnoProduct page URLMax: 2048 characters
imageUrlbodystringnoProduct image URLMax: 2048 characters
categorybodystringnoProduct categoryMax: 2048 characters
productAttributesbodyarraynoCustom product attributesSee Product attribute value

Product attribute value

ParameterLocationTypeRequiredDescriptionNotes
namebodystringyesAttribute nameMax: 256 characters
valuebodystringnoAttribute value

Order attribute value

ParameterLocationTypeRequiredDescriptionNotes
namebodystringyesAttribute nameMax: 256 characters
valuebodystringnoAttribute value

Example request

Add new order

{
  "mode": "Add",
  "data": [
    {
      "id": " 202478543",
      "date": "2024-11-15T14:32:00.000Z",
      "timeZone": "Central European Standard Time",
      "websiteId": 1,
      "status": "completed",
      "currency": "EUR",
      "totalValue": 249.99,
      "returnsValue": 0,
      "customer": {
        "email": "jon.doe@example.com",
        "phone": "+48501234567",
        "crmId": "CRM-98765"
      },
      "products": [
        {
          "id": "SKU-12345",
          "name": "Wireless Bluetooth Headphones",
          "price": 199.99,
          "quantity": 1,
          "returned": 0,
          "url": "https://shop.example.com/products/wireless-headphones",
          "imageUrl": "https://shop.example.com/images/headphones-black.jpg",
          "category": "Electronics > Audio",
          "productAttributes": [
            {
              "name": "Color",
              "value": "Black"
            },
            {
              "name": "Warranty",
              "value": "24 months"
            }
          ]
        },
        {
          "id": "SKU-67890",
          "name": "USB-C Charging cable",
          "price": 24.99,
          "quantity": 2,
          "returned": 0,
          "url": "https://shop.example.com/products/usb-c-cable",
          "imageUrl": "https://shop.example.com/images/cable-usbc.jpg",
          "category": "Electronics > Accessories"
        }
      ],
      "orderAtt
        {
          "name": "Shipping method",
          "value": "Express delivery"
        },
        {
          "name": "Payment method",
          "value": "Credit card"
        }
      ]
    }
  ]
}

Add new order or replace existing order data

{
  "mode": "AddOrReplace",
  "data": [
    {
      "id": "ORD-2024-78543",
      "date": "2024-11-15T14:32:00.000Z",
      "status": "paid",
      "currency": "EUR",
      "totalValue": 249.99,
      "customer": {
        "email": "jan.kowalski@example.com"
      },
      "products": [
        {
          "id": "SKU-12345",
          "name": "Wireless Bluetooth Headphones",
          "price": 199.99,
          "quantity": 1
        }
      ]
    }
  ]
}

Response codes

CodeStatusDescription
201CreatedOrder successfully created or updated
400Bad RequestInvalid request parameters or missing required fields
401UnauthorizedMissing or invalid API key

Example response#

201 Created

The endpoint returns an empty response body on success.

400 Bad request

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "Bad Request",
  "status": 400,
  "detail": "Validation failed",
  "instance": "/orders",
  "errors": [
    "Field 'id' is required",
    "Field 'totalValue' must be greater than or equal to 0"
  ]
}

GET /orders/{id} – retrieve order by ID

GET/orders/{id} method retrieves complete order details.

Endpoint

The endpoint for GET requests is https://api.ecdp.app/orders/{id}

Request parameters#

ParameterLocationTypeRequiredDescriptionNotes
idpathstringYesOrder identifierThe unique ID assigned when the order was created
x-api-keyheaderstringYesAPI authentication keyObtain from Settings > API

Example request

GET /orders/202478543

Response codes

CodeStatusDescription
200SuccessOrder data returned successfully
401UnauthorizedMissing or invalid API key
404Not FoundOrder with specified ID does not exist

Example response

200 Success

{
  "status": 0,
  "data": {
    "id": "202478543",
    "date": "2024-11-15T14:32:00.000Z",
    "timeZone": "Central European Standard Time",
    "websiteId": 1,
    "status": "completed",
    "currency": "EUR",
    "totalValue": 249.99,
    "returnsValue": 0,
    "customer": {
      "id": 458721,
      "email": "john.doe@example.com",
      "phone": "+48501234567",
      "crmId": "CRM-98765"
    },
    "products": [
      {
        "id": "SKU-12345",
        "name": "Wireless Bluetooth Headphones",
        "price": 199.99,
        "quantity": 1,
        "returned": 0,
        "url": "https://shop.example.com/products/wireless-headphones",
        "imageUrl": "https://shop.example.com/images/headphones-black.jpg",
        "category": "Electronics > Audio",
        "productAttributes": [
          {
            "name": "Color",
            "value": "Black"
          },
          {
            "name": "Warranty",
            "value": "24 months"
          }
        ]
      },
      {
        "id": "SKU-67890",
        "name": "USB-C Charging cable",
        "price": 24.99,
        "quantity": 2,
        "returned": 0,
        "url": "https://shop.example.com/products/usb-c-cable",
        "imageUrl": "https://shop.example.com/images/cable-usbc.jpg",
        "category": "Electronics > Accessories",
        "productAttributes": []
      }
    ],
    "orderAttributes": [
      {
        "name": "Shipping method",
        "value": "Express delivery"
      },
      {
        "name": "Payment method",
        "value": "Credit card"
      }
    ]
  }
}

404 Not Found

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
  "title": "Not Found",
  "status": 404,
  "detail": "Order not found",
  "instance": "/orders/ORD-INVALID-123"
}

PUT /orders/status – Update order status

The PUT method updates the status of an existing order.

Endpoint

The endpoint for GET requests is https://api.ecdp.app/orders/status

Request parameters

ParameterLocationTypeRequiredDescriptionAllowed values / Notes
x-api-keyheaderstringYesAPI authentication keyObtain from Settings > API
orderIdbodystringYesOrder identifierMust reference an existing order, min: 1 character
orderStatusbodystringYesNew order statusplaced, paid, completed, canceled

Example request

Mark order as paid

{
  "orderId": "202478543",
  "orderStatus": "paid"
}

Mark order as completed

{
  "orderId": "202478543 ",
  "orderStatus": "completed"
}

Response codes

CodeStatusDescription
200SuccessOrder status updated successfully
400Bad RequestInvalid status value or missing required fields
401UnauthorizedMissing or invalid API key

Example response

400 Bad Request

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "Bad Request",
  "status": 400,
  "detail": "Invalid order status",
  "instance": "/orders/status",
  "errors": [
    "Field 'orderStatus' must be one of: placed, paid, completed, canceled"
  ]
}

DELETE /orders/{id} – mark order as deleted

DELETE /orders/{id} marks an order as deleted by setting the IsDeleted flag. This operation performs a soft delete, preserving the order record for audit purposes while excluding it from active reporting and analytics.

Endpoint

The endpoint for GET requests is https://api.ecdp.app/orders/{id}

Request parameters

ParameterLocationTypeRequiredDescriptionNotes
idpathstringYesOrder identifierMust reference an existing order
x-api-keyheaderstringYesAPI authentication keyObtain from Settings > API

Example request

DELETE /orders/2024-78543

Response codes

CodeStatusDescription
200SuccessOrder marked as deleted; returns order data
401UnauthorizedMissing or invalid API key
404Not FoundOrder with specified ID does not exist

Example response

200 Success

{
  "status": 0,
  "data": {
    "id": "202478543 ",
    "date": "2024-11-15T14:32:00.000Z",
    "timeZone": "Central European Standard Time",
    "websiteId": 1,
    "status": "completed",
    "currency": "EUR",
    "totalValue": 249.99,
    "returnsValue": 0,
    "customer": {
      "id": 458721,
      "email": "john.doe@example.com",
      "phone": "+48501234567",
      "crmId": "CRM-98765"
    },
    "products": [
      {
        "id": "SKU-12345",
        "name": "Wireless Bluetooth Headphones",
        "price": 199.99,
        "quantity": 1,
        "returned": 0,
        "url": "https://shop.example.com/products/wireless-headphones",
        "imageUrl": "https://shop.example.com/images/headphones-black.jpg",
        "category": "Electronics > Audio",
        "productAttributes": [
          {
            "name": "Color",
            "value": "Black"
          }
        ]
      }
    ],
    "orderAttributes": [
      {
        "name": "Shipping method",
        "value": "Express delivery"
      }
    ]
  }
}

Validation and behavior rules

The following validation rules apply to all Orders API endpoints:

  • Order ID must be unique within the business unit.
  • At least one customer identifier (email, phone, or crmId) matching your configured matching mode is required.
  • The products array must contain at least one product with valid id, name, price, and quantity.
  • Product quantity must be at least 1. Product price and totalValue must be 0 or greater.
  • If timeZone is omitted in order date, the business unit’s configured time zone applies.
  • Order status accepts only: placed, paid, completed, canceled (case-insensitive).
  • DELETE operation performs soft delete. The order remains in the database with IsDeleted flag set to true.

Reference documentation#

Swagger – Orders

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