> 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/dlya-metodiv-stvorennya-onovlennya-vidpravlen-povyazanikh-z-moldovoyu-zmineno-formulu-rozrakhunku-ob.md).

# Для методів створення/оновлення відправлень, пов’язаних з Молдовою, змінено формулу розрахунку об'єм

<br>

| **Назва методу**  | Shipment calculation                                                                                                                                                                                                                                                 |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **HTTP Method**   | POST, PUT                                                                                                                                                                                                                                                            |
| **Роути**         | <p>POST:<br><code>/v.1.0/shipments</code><br><code>/ui/v.1.0/shipments</code><br><code>/mobileapp/v.1.1/shipments</code></p><p>PUT:<br><code>/v.1.0/shipments/{id}</code><br><code>/ui/v.1.0/shipments/{id}</code><br><code>/mobileapp/v.1.1/shipmentsons</code></p> |
| **Тип зміни**     | Зміни до існуючої кінцевої точки                                                                                                                                                                                                                                     |
| **Авторизація**   | `Authorization: Bearer jwt-token…`                                                                                                                                                                                                                                   |
| **System/module** | client-api, Мobile App, UI *(*`/ui/` `/mobileapp/` `/v.1.0/`)                                                                                                                                                                                                        |

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

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

**Суть зміни**

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

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

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

**Правила, коли необхідно застосовувати дільник 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"` і договір з платником з Молдови.

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

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

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

Якщо ні – контракт не є молдавським, і формулу з дільником 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 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/dlya-metodiv-stvorennya-onovlennya-vidpravlen-povyazanikh-z-moldovoyu-zmineno-formulu-rozrakhunku-ob.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.
