# Execute Order Rules

## Overview

This endpoint allows you to access Sellercloud’s Order Rule Engine. By consuming it, you can trigger executing existing rules on one or several orders. To use this endpoint, you must:

- Be an authenticated user

For information on how you can authenticate, see [Authentication](https://developer.sellercloud.com/dev-article/authentication/).

As soon as you authenticate and receive a valid token, it needs to be passed on to the service call.

## Endpoint

An example of such an endpoint for XX server is:

​​https://xx.api.sellercloud.com/rest/api/Settings/OrdersRuleEngine/ExecuteRules

For your server, the endpoint will be:

https://{your_server_id}.api.sellercloud.com/rest/api/Settings/OrdersRuleEngine/ExecuteRules

## Request

- Method Type: **HttpPost**  
- Authorization: Use **Bearer Token** (where ‘Token’ is the token received from the token authentication)  
- Header info: **Content-Type: application/json**  
- Parameters:

| **Parameter**      | **Data Type** | **Description**                                                                                                                                               | **Is Required**                                 |
|--------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|
| OrdersIDs          | integer        | List of existing orders the Rule should be executed on.                                                                                                     | Yes                                              |
| RulesToExecute     | integer        | Specify which existing rules should be executed:<br>0 = Enabled Only<br>1 = All<br>2 = Custom<br>If you select Custom, you must provide the specific Rule IDs in the CustomRulesIDs parameter. | Yes                                              |
| CustomRulesIDs     | integer        | List of existing Rule IDs to execute.                                                                                                                       | Yes – only if you have provided 2=Custom for the RulesToExecute parameter. |

### Request Body

```json
{
  "OrdersIDs": [
    0
  ],
  "RulesToExecute": 0,
  "CustomRulesIDs": [
    0
  ]
}
```

## Response

- If the user is authenticated, the response will be **Status Code 200 => OK**  
- If the user is not authenticated, then the response will be **Status Code 401 => Not Valid Token**  
- On server response => **Status Code 500 => Internal Server Error**
