> 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**

| **Назва методу** | Delete document                                                                                                                                                                                          |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **HTTP Метод**   | DELETE                                                                                                                                                                                                   |
| Роути            | <p>DELETE /ui/v.1.0/shipments/{id}</p><p>DELETE /v.1.0/shipments/{id}</p><p>DELETE /mobileapp/v.1.1/shipments/{id}</p><p>DELETE /cbc/v.1.0/shipments/{id}</p><p>DELETE /internal/awis/shipments/{id}</p> |
| Тип зміни        | existing endpoint update                                                                                                                                                                                 |
| **Авторизація**  | Authorization: Bearer jwt-token…                                                                                                                                                                         |

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

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

```
withDeleted=1
```

<details>

<summary></summary>

</details>

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

```
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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
