> 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/checklists/ua/zmina-semantiki-polya-externalid-u-dovidniku-viddilen.md).

# Зміна семантики поля externalId у довіднику відділень

З **01 січня 2027 року** змінюється внутрішня логіка та призначення поля `externalId` у відповіді методу `GET /v.1.0/divisions`.

Щоб забезпечити стабільну роботу вашої інтеграції, нагадуємо, що поле `externalId` є внутрішнім службовим атрибутом. Для уникнення сбоїв у майбутньому **вкрай не рекомендується**:

* використовувати для ідентифікації відділень;
* зберігати як постійний унікальний ключ у базі даних;
* передавати у вхідних параметрах інших методів API.

Поле `externalId` залишиться у структурі відповіді, проте його формат, значення та призначення можуть довільно змінюватися в майбутньому.

#### **Рекомендовані дії для оновлення інтеграції**

Для ідентифікації відділень у системі призначено поле `items[].id`.

Якщо у вашій інтеграції зараз використовується `externalId`, необхідно до **01.01.2027** виконати такі кроки:

1. **Оновити довідник:** Виконати запит `GET /v.1.0/divisions` та отримати актуальний перелік відділень, деталі [Довідники | API Docs | NovaPost](https://api-portal.novapost.com/methods/ua/overview/dictionaries#get-divisions) або офлайн довідник [Довідники | API Docs | NovaPost](https://api-portal.novapost.com/methods/ua/overview/dictionaries#get-dictionary-divisions)
2. **Перейти на коректний ID:** Зберегти поле `items[].id` як основний ідентифікатор відділення у вашій системі.
3. **Оновити запити:** Замінити `externalId` на відповідне значення `id` у запитах на створення відправлень та пошук відділень.

Наприклад, отримуємо відповідь по запиту `GET /v.1.0/divisions`, в котрому необхідно зберегти значення `id = 4493`.

```json
{
    "current_page": 1,
    "last_page": 1,
    "per_page": 15,
    "total": 1,
    "from": null,
    "to": null,
    "items": [
        {
            "id": 4493,
            "name": "Пункт приймання-видачі (до 30 кг): вул. Шкільна, 152",
            "shortName": "Пункт приймання-видачі (до 30 кг): вул. Шкільна, 152",
            "externalId": "7ce49933-9912-11ea-a768-b8830365bd14",
            "source": "NPUA",
            "countryCode": "UA",
            "settlement": {
                "id": 122776,
               "name": "village Myliach",
"region": {
                    "id": 864,
                    "name": "Dubrovytskyi raion",
                    "parent": {
                        "id": 413,
                        "name": "Rivnenska oblast"
                    }
               }
            }

```

В запиті на створення відправлення `POST /v.1.0/shipments` в передаємо "divisionId": 4493

```json
{
  "status": "ReadyToShip",
  "clientOrder": "",
  "note": "",
  "payerType": "Sender",
  "invoice": null,
  "services": [],
  "parcels": [
    {
      "cargoCategory": "parcel",
      "number": null,
      "parcelDescription": "parcel for redirect test",
      "insuranceCost": 100,
      "rowNumber": 1,
      "width": 200,
      "length": 350,
      "height": 100,
      "actualWeight": 2000,
      "volumetricWeight": 2000
    }
  ],
  "sender": {
    "companyTin": "",
    "companyName": "",
    "phone": "380007654321",
    "email": "sender@test.com",
    "name": "Maks Tester",
    "countryCode": "UA",
    "divisionId": 4493,
    "addressParts": {}
  },
  "recipient": {
    "companyTin": "",
    "companyName": "",
    "phone": "380001234567",
    "email": "recipient@test.com",
    "name": "Chuck Norris",
    "countryCode": "PL",
    "divisionId": 27255,
    "addressParts": {}
  }
}
```

**Важливо для legacy-інтеграцій по Україні:**

Якщо ваша система використовує для створення відправлень ідентифікатор адреси отримувача (REF) або ідентифікатор поштомата для старих інтеграцій по Україні, це значення знаходиться в об'єкті додаткових параметрів в ендпоінті `GET /v.1.0/divisions`, за шляхом:

`items[].additionalIds[type="InternetAddress"].value`

приклад:

```json
            "additionalIds": [
                {
                    "type": "InternetAddress",
                    "partner": "NPUkraine",
                    "countryCode": "UA",
                    "value": "7ce49933-9912-11ea-a768-b8830365bd14"
                }
            ],
```

**Рекомендація:** Для стабільної та довгострокової роботи радимо перейти на [оновлені ендпоінти API для відправлень](https://api-portal.novapost.com/methods/ua/overview/shipments): [Відправлення | API Docs | NovaPost](https://api-portal.novapost.com/methods/ua/overview/shipments) та використовувати в **divisionId=**`items[].id`.


---

# 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/checklists/ua/zmina-semantiki-polya-externalid-u-dovidniku-viddilen.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.
