---
updatedAt: 2026-04-21T09:18:29.000Z
agentTools:
  projectIndex: https://docs.esputnik.com/llms.txt
---

# Delete orders

This endpoint schedules an asynchronous order deletion job.<br/>Supported deletion criteria:<br/>• externalOrderId (deletes the order with the specified externalOrderId), or<br/>• from and to (deletes orders whose occurrence timestamp falls within the specified period).

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "esputnik.com",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://esputnik.com"
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Orders"
    }
  ],
  "paths": {
    "/api/v1/orders": {
      "delete": {
        "tags": [
          "Orders"
        ],
        "summary": "Delete orders",
        "description": "This endpoint schedules an asynchronous order deletion job.<br/>Supported deletion criteria:<br/>• externalOrderId (deletes the order with the specified externalOrderId), or<br/>• from and to (deletes orders whose occurrence timestamp falls within the specified period).",
        "operationId": "removeHistoryOrders",
        "parameters": [
          {
            "name": "externalOrderId",
            "in": "query",
            "description": "ID of an order in the external system",
            "schema": {
              "type": "string"
            },
            "example": "BC12345678"
          },
          {
            "name": "from",
            "in": "query",
            "description": "Start date (inclusively)",
            "schema": {
              "type": "string"
            },
            "example": "2023-08-14T10:25"
          },
          {
            "name": "to",
            "in": "query",
            "description": "End date (inclusively)",
            "schema": {
              "type": "string"
            },
            "example": "2023-10-12T12:33"
          }
        ],
        "responses": {
          "200": {
            "description": "Request parameters are valid and the deletion job is accepted for processing",
            "content": {
              "application/json; charset=UTF-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Incorrect input data:<br><ul><li>Provide either <code>externalOrderId</code>, or both <code>from</code> and <code>to</code> parameters.</li><li><strong>Invalid date format.</strong> Supported: <code>yyyy-MM-dd'T'HH:mm:ss</code> — e.g. <code>2024-12-31T23:59:59</code> (UTC).</li><li>Start date (<code>from</code>) must be before end date (<code>to</code>).</li><li>Date range cannot exceed <code>24</code> hours.</li></ul>"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}
```