Orders – API methods
The Orders API lets you automate tasks related to your customers’ orders. Think of it as a direct line between your system and ours – no manual data entry required.
We offer 4 HTTP methods to work with order data:
- POST – add new orders or update existing order information.
- GET – retrieve order details using the order ID.
- PUT – register orders that haven’t been added to the platform yet.
DELETE – mark orders as deleted (sets the IsDeleted status).
POST method – adding order information
This method handles both new orders and updates to existing ones. You can choose from 3 different modes:
- Add – adds a completely new order to your account.
- AddOrReplace – adds a new order or replaces existing data if the order is already in the system.
- Replace – updates the information for an existing order.
Endpoint
The endpoint for POST requests is:: https://api.ecdp.app/orders
Request parameters
| Parameter | Required | Type | Category | Min/max length (characters) | Description |
| x-api-key | yes | string | header | – | Your API key, which you can find in Settings > API. |
| mode | yes | string | body | – | Add, AddOrReplace, Replace – choose what do you want to do with the order data. |
| id | yes | string | body | min:1 max: 128 | Order ID number. |
| date | yes | string($date-time) | body | – | When the order was placed. |
| timeZone | no | string | body | max: 100 | The time zone the order was placed in. See: Supported time zones for orders for parameter values. If you don’t provide it, your unit’s time zone will be used to interpret the order date. You can find it in Settings > General > Time zone field. |
| websiteId | no | integer($int32) | body | – | Website ID number where the order was placed. |
| status | no | string | body | – | One of four order statuses: placed, paid, completed, canceled. |
| currency | no | string | body | min: 3 max: 3 | Order currency. |
| totalValue | yes | number($double) | body | min: 0 | Total order value. |
| customer | yes | body | Customer information – see Customer parameters. | ||
| products | yes | body | Product details – see Product parameters. | ||
| orderAttribute | no | body | Optional product attributes – see Product attribute parameters. |
The customer, products, and orderAttributes parameters contain their own sub-parameters for more detailed information.
Customer parameters
| Parameter | Required | Type | Min/max length (characters) | Description |
| no | string | min: 0 max: 320 | Customer’s email address – required if email is set as the default matching mode in Settings > Customers. | |
| phone | no | string | min:0 max: 20 | Customer’s phone number – required if phone is set as the default matching mode in Settings > Customers. |
| crmId | no | string | min: 0 max: 128 | Customer’s CRM ID – required if CRM ID is set as the default matching mode in Settings > Customers. |
Product parameters
| Parameter | Required | Type | Min/max length (characters) | Description |
| id* | yes | string | min: 1 max:128 | Product ID. |
| name* | yes | string | min: 1 max: 2048 | Product name. |
| price* | yes | number($double) | min: 0 | Product price. |
| quantity* | yes | integer($int32) | min:1 max: 2147483647 | Quantity of purchased product. |
| returned | no | integer($int32) | min: 0 max: 2147483647 | Number of returned products. |
| url | no | string | min: 0 max: 2048 | Product page URL. |
| imageUrl | no | string | min: 0 max: 2048 | Product image URL. |
| category | no | string | min: 0 max: 2048 | Product category. |
| productAttributes | no | Product attributes – see Order attribute parameters. |
Product attribute parameters
| Parameter | Required | Type | Min/max length (characters) | Description |
| name* | yes | string | min: 0 max: 256 | Product attribute name. |
| value | no | string | – | Product attribute value. |
Order attribute parameters
| Parameter | Required | Type | Min/max length (characters) | Description |
| name* | yes | string | min: 0 max: 256 | Order attribute name. |
| value | no | string | – | Order attribute value. |
Request body syntax
Here’s what a request looks like when you want to add a new order:
{
"mode": "Add",
"data": [
{
"id": "12345",
"date": "2024-11-06T10:10:00.055Z",
"timeZone": "Pacific Standard Time",
"websiteId": 1,
"status": "Completed",
"currency": "USD",
"totalValue": 150.00,
"returnsValue": 0,
"customer": {
"email": "customer@example.com",
"phone": "+15551234567",
"crmId": "67890"
},
"products": [
{
"id": "p001",
"name": "Wireless Earbuds",
"price": 75.00,
"quantity": 2,
"returned": 0,
"url": "https://example.com/products/wireless-earbuds",
"imageUrl": "https://example.com/images/wireless-earbuds.jpg",
"category": "Electronics",
"productAttributes": [
{
"name": "Color",
"value": "Black"
},
{
"name": "Warranty",
"value": "1 Year"
}
]
}
],
"orderAttributes": [
{
"name": "Shipping Method",
"value": "Express"
},
{
"name": "Gift Wrap",
"value": "Yes"
}
]
}
]
}Not sure if an order already exists in your database? Simply change the “mode” parameter to “AddOrReplace” and let the system handle it for you.
Response codes
201: Created
Your request was successful, and the order has been created.
400: Bad request
Something went wrong with your request – usually a missing or incorrect parameter.
Sample response:
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"errors": [
"string"
]401: Unauthorized
Your API key is missing or you don’t have permission to access this information. Sample response:
{
{
"type": "string",
"title": "string",
"status": 0,
"substatus": "CustomerInvalidModelState",
"detail": "string",
"instance": "string"
}GET{id} method – retrieving order information using order ID
Use the GET method when you need to pull order details from the system using order ID. A successful request returns read-only order data.
Endpoint
The endpoint for GET requests is: https://api.ecdp.app/orders/{id}
Request parameters
| Parameter | Required | Type | Used in | Description |
| id | yes | string | URL path | The ID number of the order whose data you want. |
| x-api-key | yes | string | header | Your API key, which you can find in Settings > API. |
Proper request format
The correct API request for order number 12 looks like this: https://client.ecdp.app/orders/{12}
Response codes
200: Success
Your request was processed successfully.
Sample response:
{
"status": 0,
"data": {
"id": "string",
"date": "2024-07-25T10:08:59.197Z",
"timeZone": "string",
"websiteId": 0,
"status": "string",
"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
Your API key is missing, or you don’t have permission to access this information.
Sample response:
{
"type": "string",
"title": "string",
"status": 0,
"substatus": "CustomerInvalidModelState",
"detail": "string",
"instance": "string"
}404: Not found
The order you’re looking for doesn’t exist in the system.
Sample response:
{ "type": "string",
"title": "string",
"status": 0,
"substatus": "CustomerInvalidModelState",
"detail": "string",
"instance": "string"
}PUT method – updating order status
This method handles orders that haven’t been given a status in the platform yet, or which status you want to update. When you send a successful PUT request, you’ll get a read-only response confirming the order status has been updated.
Endpoint
The endpoint for PUT method is:https://api.ecdp.app/orders/status
Request parameters
| Parameter | Required | Type | Used in | Description |
| orderId | yes | string | body | The ID number of the order whose status you want to update. |
| orderStatus | yes | string | body | One of the following order statuses available in ECDP: paid, completed, placed, canceled. |
| x-api-key | yes | string | header | Your API key, which you can find in Settings > API. |
Proper request format
The correct API request for order number 12 and looks like this:
{
"orderId": "12",
"orderStatus": placed"
}Response codes
200: Success
Your request was processed, and the order status has been updated.
400: Bad request
Something went wrong – usually a missing or incorrect parameter.
Sample response:
{
"type": "string",
"title": "string",
"status": 0,
"substatus": "CustomerInvalidModelState",
"detail": "string",
"instance": "string",
"errors": [
"string"
]
}401: Unauthorized
Your API key is missing or you don’t have permission to access this information.
Sample response:
{
"type": "string",
"title": "string",
"status": 0,
"substatus": "CustomerInvalidModelState",
"detail": "string",
"instance": "string"
}DELETE{id} method – marking orders as deleted
Use the DELETE method to change an order’s status to IsDeleted. This doesn’t actually remove the order from your system – it just marks it as deleted. A successful request returns a read-only response.
Endpoint
The endpoint for DELETE method is:https://api.ecdp.app/orders/{id}
Request parameters
| Parameter | Required | Type | Used in | Description |
| id | yes | string | URL path | The ID number of the order you want to mark as deleted. |
| x-api-key | yes | string | header | Your API key, which you can find in Settings > API. |
Response codes
200: Success
The order status has been updated to deleted. Sample response:
{
"status": 0,
"data": {
"id": "string",
"date": "2024-07-25T10:10:53.036Z",
"timeZone": "string",
"websiteId": 0,
"status": "string",
"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
Your API key is missing or you don’t have permission to access this information. Sample response:
{
"type": "string",
"title": "string",
"status": 0,
"substatus": "CustomerInvalidModelState",
"detail": "string",
"instance": "string"
}404: Not found
The order you’re trying to delete doesn’t exist in the system.
Sample response:
{
"type": "string",
"title": "string",
"status": 0,
"substatus": "CustomerInvalidModelState",
"detail": "string",
"instance": "string"
}