> 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/post-shipments-calculations-rozrakhunok-obyemnoyi-vagi-dilnik-5000.md).

# POST /shipments/calculations: Розрахунок об'ємної ваги \[дільник 5000]

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

<table data-header-hidden><thead><tr><th width="237"></th><th></th></tr></thead><tbody><tr><td><strong>Назва методу</strong></td><td>Shipment calculation</td></tr><tr><td><strong>HTTP Method</strong></td><td>POST</td></tr><tr><td><strong>Роут</strong></td><td><code>/v.1.0/shipments/calculations</code><br><code>/mobileapp/v.1.1/shipments/calculations</code><br><code>/ui/v.1.0/shipments/calculations</code> <br><br><code>ui/v.1.0/shipments/delivery-calculations</code><br><code>ui/site/v.1.0/shipments/delivery-calculations</code></td></tr><tr><td><strong>Тип зміни</strong></td><td>Changes to existing endpoint</td></tr><tr><td><strong>Авторизація</strong></td><td><code>Authorization: Bearer jwt-token…</code></td></tr></tbody></table>

### Опис <a href="#description" id="description"></a>

Для кінцевих відправлень/розрахунків (`POST /shipments/calculations`) змінено логіку розрахунку об’ємної ваги (`volumetricWeight`) для відправлень, пов’язаних із Молдовою.

#### Суть зміни <a href="#essence-of-the-change" id="essence-of-the-change"></a>

Для всіх країн об'ємну вагу розраховували так:\
`volumetricWeight = length * width * height / 4000`

**Після змін:**

* Для відправлень, пов'язаних з Молдовою, об'ємну вагу необхідно розраховувати так:\
  `volumetricWeight = length * width * height / 5000`. See rules below.
* Для всіх інших відправлень формула з дільником 4000 залишається незмінною.

`volumetricWeight` обчислюється на стороні API Gateway, навіть якщо `parcels[].volumetricWeight` не надсилається в запиті або надсилається як null.

&#x20;

#### Правила, коли необхідно застосовувати дільник 5000 (Молдова)

Формула з дільником 5000 використовується, якщо виконується хоча б один із наступних випадків:

1. Внутрішні перевезення в межах Молдови
   * Відправник та одержувач знаходяться в Молдові
   * `sender.countryCode = "MD"`
   * `recipient.countryCode = "MD"`
2. Відправлення з Молдови, де платник = відправник або третя особа з молдавським контрактом
   * `sender.countryCode = "MD"`
   * Платник за відправлення:
     * `payerType = "Sender"` **OR**
     * `payerType = "ThirdPerson"` і договір з платником з Молдови.
3. Відправлення до Молдови та платник = одержувач або третя особа з молдавським договором
   * `recipient.countryCode = "MD"`
   * Payer of the shipment:
     * `payerType = "Recipient"` **OR**
     * `payerType = "ThirdPerson"` і договір з платником з Молдови.

&#x20;

#### Визначення «молдавського» контракту для третьої особи

Якщо `payerType = "ThirdPerson"`, щоб визначити, що платник є третьою стороною за молдавським договором:

1. Візьміть номер договору з `payerContractNumber` в `/shipments` запит.
2. Виклич`/api/contracts/` з:
   * `numbers[] = {payerContractNumber}`
   * `countryCodes[] = MD`
3. Якщо відповідь для фільтру `countryCodes[] = MD` містить контракт із цим номером – контракт вважається молдавським.&#x20;

Якщо ні – контракт не є молдавським, і формулу з дільником 5000 застосовувати не слід.

Приклад:

`GET /api/contracts/?numbers[]=GNPMD-00020861&countryCodes[]=MD`


---

# 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/post-shipments-calculations-rozrakhunok-obyemnoyi-vagi-dilnik-5000.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.
