> For the complete documentation index, see [llms.txt](https://api-portal.novapost.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-portal.novapost.com/changelog-1/documentation-1/otrimannya-vidpovidi-pri-povtornomu-vidalenni-men.md).

# Отримання відповіді при повторному видаленні МЕН

#### Загальна інформація <a href="#general-information" id="general-information"></a>

Для коректної обробки повторних запитів на видалення відправлень виконується додаткова перевірка статусу відправлення через службу відстеження. Мета полягає в тому, щоб повернути уніфіковану відповідь `shipment_was_deleted`, якщо відправлення вже було видалено.

**Method Name**

<table data-header-hidden><thead><tr><th width="259"></th><th></th></tr></thead><tbody><tr><td><strong>Назва методу</strong></td><td>Delete document</td></tr><tr><td><strong>HTTP Метод</strong></td><td>DELETE</td></tr><tr><td>Роути</td><td><p><code>DELETE /ui/v.1.0/shipments/{id}</code></p><p><code>DELETE /v.1.0/shipments/{id}</code></p><p><code>DELETE /mobileapp/v.1.1/shipments/{id}</code></p><p><code>DELETE /cbc/v.1.0/shipments/{id}</code></p><p><code>DELETE /internal/awis/shipments/{id}</code></p></td></tr><tr><td>Тип зміни</td><td>existing endpoint update</td></tr><tr><td><strong>Авторизація</strong></td><td> <code>Authorization: Bearer jwt-token…</code></td></tr></tbody></table>

#### Логіка <a href="#description" id="description"></a>

Під час виконання запиту на видалення відправлення API додатково надсилає запит GET до служби відстеження, використовуючи такий параметр:

```
withDeleted=1
```

Цей параметр дозволяє отримати дані для раніше видалених відправлень. Потім відповідь аналізується на основі поля:

```
deleted_at
```

якщо `deleted_at ≠ null` → відправлення було видалено раніше; API повертає:

```
{
  "errors": {
    "errorMessage": "shipment_was_deleted"
  }
}
```

HTTP-статус: `422` Необроблювана сутність якщо `deleted_at = null` або поле відсутнє → відправлення не знайдено; поточна поведінка залишається незмінною, і API повертає:

```
{
  "errors": {
    "errorMessage": "shipment_not_found"
  }
}
```

**HTTP status:** `404 Not Found`

#### Приклад запиту

```
DELETE /shipments/{id}
```

#### Успішна відповідь

```
{
  "success": true
}
```

**HTTP status:** `200 OK`

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://api-portal.novapost.com/changelog-1/documentation-1/otrimannya-vidpovidi-pri-povtornomu-vidalenni-men.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
