Skip to content

Orders – API methods 

Using API, you can automate activities related to orders placed by your customers. We provide 3 HTTP methods: 

  1. POST – Adding a new order or updating order data. 
  2. GET{id}  – Obtaining information about an order using the order ID number. 
  3. PUT – Adding an order that has not been registered in the platform. 
  4. DELETE{id} – Changing order status to ‘deleted’ (IsDeleted). 

POST method – adding order information 

The actions you can perform using this method include adding new orders data and updating data about already placed orders. There are 3 modes for this (modes): 

  • Add – Adding an order in ExpertSender. 
  • AddOrReplace – Adding a new order to the platform or replacing its data, if the order is already in the platform. 
  • Replace – Changing the data set in the order.

POST method – query 

To send a query using this method, it must contain: 

  1. Server address (endpoint): https://api.ecdp.app/orders  
  2. Parameters
Parameter Type Category Description 
x-api-key string header Your API key, which you can find in Settings > API. 
id string body Order ID number, minimum number of characters: 1 
date string($date-time) body Date of placing the order 
totalValue number($double) body Total order value, minimum number of characters: 0 
customer  body Customer attributes; includes an additional set of parameters >>> see table below 
products  body Product data; includes an additional set of parameters >>> see table below 

The customer, products and orderAttributes parameters have their own parameters that will allow you to add or obtain more detailed order information. Parameters marked with an asterisk must be included in the query. 

For customers these are: 

Parameter Type Description 
email string Email address of the customer who placed the order 
phone string Telephone number of the customer who placed the order 
crmId string CRM ID number of the customer who placed the order 

For products these are: 

Parameter Type  Description 
id* string ID number of the purchased product; minimum number of characters: 1 
name* string Product name; minimum number of characters: 1 
price* number($double) Product price; minimum number of characters: 0 
quantity* integer($int32) Quantity of product purchased; minimum number of characters: 1, maximum number of characters: 2147483647 
returned integer($int32) Number of returned products; minimum number of characters: 0, maximum number of characters: 2147483647 
url string URL of the purchased product 
imageUrl string Image URL of the purchased product 
category string Category of the purchased product 
productAttributes  Product attributes; includes an additional set of parameters >>> see table below 

For productAttributes these are: 

Parameter Type  Description 
name* string Product feature name; minimum number of characters: 1 
value string Product feature value 

For orderAttributes these are: 

Parameter Type  Description 
name* string Order feature name; minimum number of characters: 1 
value string Value of the order feature 

Query syntax for the POST method 

Below you can see an example syntax of the query that allows you to add (Add) an order to the database: 

{
  "mode": "Add",
  "data": [
    {
      "id": "string",
      "date": "2023-07-26T07:33:13.787Z",
      "timeZone": "string",
      "websiteId": 0,
      "currency": "str",
      "totalValue": 0,
      "returnsValue": 0,
      "customer": {
        "email": "string",
        "phone": "string",
        "crmId": "string"
      },
      "products": [
        {
          "id": "string",
          "name": "string",
          "price": 0,
          "quantity": 2147483647,
          "returned": 2147483647,
          "url": "string",
          "imageUrl": "string",
          "category": "string",
          "productAttributes": [
            {
              "name": "string",
              "value": "string"
            }
          ]
        }
      ],
      "orderAttributes": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ]
}

When updating order data, change the “mode” parameter to “Update”

If you do not know whether a given order is already in the database and you want to add its data, change the “mode” parameter to “AddOrUpdate”.

POST query response codes 

201: Created

The request has been created.

400: Bad request

The request was not processed. The reason is usually a missing or incorrect parameter. Sample response syntax:

{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "errors": [
    "string"
  ]
}

401: Unauthorized

The request was missing an API key or you are requesting access to information that you do not have permission to access. Sample response syntax:

{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string"
}

GET method – obtaining information about the order 

The GET method is used to obtain information from ExpertSender about the order placed by the customer. For a valid GET query, you will receive a response with a ‘read-only’ status.

GET{id} method using the order ID number 

To send a query using this method, it must contain: 

  1. Server address (endpoint): https://api.ecdp.app/orders/{id} 
  2. Order ID: Order number 
  3. API key: Your API key, which you can find in Settings > API. 

The correct API request for order number 12 looks like this: https://client.ecdp.app/orders/{12}

GET{id} query response codes

200: Success

The query was processed, the server returned a response. Sample response syntax:

{
  "status": 0,
  "data": {
    "id": "string",
    "date": "2023-07-26T08:03:15.291Z",
    "timeZone": "string",
    "websiteId": 0,
    "currency": "str",
    "totalValue": 0,
    "returnsValue": 0,
    "customer": {
      "id": 0,
      "email": "string",
      "phone": "string",
      "crmId": "string"
    },
    "products": [
      {
        "id": "string",
        "name": "string",
        "price": 0,
        "quantity": 2147483647,
        "returned": 2147483647,
        "url": "string",
        "imageUrl": "string",
        "category": "string",
        "productAttributes": [
          {
            "name": "string",
            "value": "string"
          }
        ]
      }
    ],
    "orderAttributes": [
      {
        "name": "string",
        "value": "string"
      }
    ]
  }
}

401: Unauthorized

The request was missing an API key or you are requesting access to information that you do not have permission to access. Sample response syntax: 

{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string"
}

404: Not found

The data you are looking for is not on the server. Sample response syntax:

{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string"
}

PUT method – adding an order that has not been registered in the platform 

The method is used to add order details that have not been registered in the platform. 
 

The PUT method is used to change the status of an order registered in ExpertSender. For a correct query using the PUT method, you will receive a response with a ‘read-only’ status.

PUT method – query

To send a query using this method, it must contain: 

  1. Server address (endpoint): https://api.ecdp.app/orders 
  2. API key: Your API key, found in Settings > API. 
  3. Parameters, i.e., data about the selected order. Each query must contain parameters marked with an asterisk. 
Parameter Type Description 
websiteId* Integer($int32) ID number of the store page from which the order comes 
visitorId* string($uuid) ID number of the store website visitor 
orderId* string Order ID number; minimum number of characters: 1 

Query syntax for the PUT method

Below you can see an example syntax of the query that can be used to change the order status: 

{
  "websiteId": 0,
  "visitorId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "orderId": "string"
}

PUT query response codes

200: Success

The query was processed, the server returned a response.

400: Bad request

The request was not processed. The reason is usually a missing or incorrect parameter. Sample response syntax:

{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "errors": [
    "string"
  ]
}

401: Unauthorized

The request was missing an API key, or you are requesting access to information that you do not have permission to access. Sample response syntax:

{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string"
}

DELETE{id} method – changing the order status to IsDeleted

The PUT method is used to change the status of an order registered in ExpertSender to Deleted (IsDeleted). 

 
For a correct query using the PUT method, you will receive a response with a ‘read-only’ status.

DELETE{id} method – query 

To send a query using this method, it must contain: 

  1. Server address (endpoint): https://api.ecdp.app/orders/{orderId} 
  2. Order ID: Order ID number 
  3. API key: Your API key, found in Settings > API. 

The correct API query to change the status of order number 12 to Deleted looks like this: https://client.ecdp.app/orders/{12}

DELETE{id} query response codes

200: Success

The query was processed, the server returned a response. Sample response syntax:

{
  "status": 0,
  "data": {
    "id": "string",
    "date": "2023-07-26T08:32:22.590Z",
    "timeZone": "string",
    "websiteId": 0,
    "currency": "str",
    "totalValue": 0,
    "returnsValue": 0,
    "customer": {
      "id": 0,
      "email": "string",
      "phone": "string",
      "crmId": "string"
    },
    "products": [
      {
        "id": "string",
        "name": "string",
        "price": 0,
        "quantity": 2147483647,
        "returned": 2147483647,
        "url": "string",
        "imageUrl": "string",
        "category": "string",
        "productAttributes": [
          {
            "name": "string",
            "value": "string"
          }
        ]
      }
    ],
    "orderAttributes": [
      {
        "name": "string",
        "value": "string"
      }
    ]
}

401: Unauthorized

The request was missing an API key or you are requesting access to information that you do not have permission to access. Sample response syntax:

{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string"
}

404: Not found

The data you are looking for is not on the server. Sample response syntax:

{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string"
}
On this page
To top