# Microsoft Dynamics 365 Business Central

> How Business Central hands serial numbers to BatteryPass through its API and a custom API page.

> [!NOTE]
> This page describes an integration pattern. BatteryPass ships no connector for Business Central and has no
> partnership with Microsoft; nothing here is a vendor approval.

The standard API v2.0 returns items and item ledger entries, but `itemLedgerEntries` has no serial or lot number
fields. Serial numbers therefore need a custom AL API page, written by your partner or your own IT, that returns item
ledger entries with their serial number. The `business-central-serials` preset matches its columns (and the column
names of the Excel export of the user interface, German and English); it assumes the model identifier in BatteryPass
is the item number.

The middleware signs in through Microsoft Entra ID as a service (client credentials). To notice new entries it can
subscribe to webhooks with `POST /api/v2.0/subscriptions`: Business Central checks the address with a validation
handshake, sends thin notifications (the resource and the kind of change) with your `clientState`, and lets a
subscription expire after three days, so renew it in time. The notifications are not signed: check the `clientState`
and read the changed resource through the API before acting.

From there the steps are those of [units from production](https://passport.kabin.sh/docs/en/integrations/workflows/units-from-production) and
[passport links back into the ERP](https://passport.kabin.sh/docs/en/integrations/workflows/passport-links-to-erp).

## Interfaces and how they were checked

- **Vendor:** Microsoft
- **Cloud:** Business Central online (API v2.0)
- **On-premise:** Business Central on-premises (API v2.0)

The standard API returns item ledger entries without serial and lot numbers; that needs a custom AL API page. Webhook subscriptions expire after three days and must be renewed.

An integration pattern, not a connector: BatteryPass ships no ERP connector and holds no vendor certification.

| Interface                                                                                                                                                                                                 | Protocol | Sign-in                      | Events                | Objects                                       | Checked                                         |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------- | --------------------- | --------------------------------------------- | ----------------------------------------------- |
| [`API v2.0`](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/resources/dynamics_itemledgerentry) (Standard API (items, item ledger entries, sales documents)) | OData V4 | OAuth 2.0 client credentials | none                  | Product/material master, Delivery/goods issue | checked in the vendor documentation, 24/10/2026 |
| [`Webhook subscriptions (/api/v2.0/subscriptions)`](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/dynamics-subscriptions) (Change notifications)            | REST     | OAuth 2.0 client credentials | Webhooks (not signed) | Product/material master, Delivery/goods issue | checked in the vendor documentation, 24/10/2026 |
| `Custom AL API page` (Custom API page for item ledger entries with serial numbers)                                                                                                                        | OData V4 | OAuth 2.0 client credentials | none                  | Batch/serial number                           | checked in the vendor documentation, 24/10/2026 |

**Notes**

- `API v2.0`: Sign-in through Microsoft Entra ID (service to service); itemLedgerEntries has no serial or lot number fields.
- `Webhook subscriptions (/api/v2.0/subscriptions)`: On creation Business Central checks the address with a validation handshake. Notifications are thin (the resource and the kind of change) and carry the subscription's clientState, but no signature.
- `Custom AL API page`: An extension the partner or your own IT writes; it returns the columns of the business-central-serials preset.

**Import presets: Business Central item ledger with serial numbers** (`business-central-serials`): Item ledger entries from Microsoft Dynamics 365 Business Central with their serial number, as a custom AL API page returns them (the standard itemLedgerEntries API has no serial numbers). Column names of the API page and of the user interface's Excel export (German and English). Assumes that the model identifier is the item number.

| Column in the export                             | Field in BatteryPass                                     |
| ------------------------------------------------ | -------------------------------------------------------- |
| `itemNo` (also Item No., Artikelnr.)             | Model identifier / SKU `identification.model_identifier` |
| `serialNo` (also Serial No., Seriennr.)          | Serial number `identification.serial_number`             |
| `postingDate` (also Posting Date, Buchungsdatum) | Manufacturing date `identification.manufacturing_date`   |

**Import presets: Generic CSV file** (`generic-csv`): For any ERP and for files a middleware writes itself: GTIN, serial number, manufacturing date, facility (name or GLN), model version and battery status, with German and English column names.

| Column in the export                                          | Field in BatteryPass                                      |
| ------------------------------------------------------------- | --------------------------------------------------------- |
| `GTIN` (also EAN, GTIN-13, GTIN-14)                           | GTIN (GS1) `identification.gtin`                          |
| `Serial number` (also Seriennummer, serial_number)            | Serial number `identification.serial_number`              |
| `Manufacturing date` (also Herstelldatum, manufacturing_date) | Manufacturing date `identification.manufacturing_date`    |
| `Facility` (also Produktionsstätte, Facility GLN, Werk-GLN)   | Place of manufacture `identification.manufacturing_place` |
| `Model version` (also Modellversion, model_version)           | Model version `model_version`                             |
| `Battery status` (also Batteriestatus, battery_status)        | Battery status `identification.battery_status`            |

## Workflows

- [Units from production](https://passport.kabin.sh/docs/en/integrations/workflows/units-from-production.md): Serial numbers from the production confirmation or goods receipt are staged as an import; members review, commit and approve before any passport appears. Key scopes: import
- [Passport links back into the ERP](https://passport.kabin.sh/docs/en/integrations/workflows/passport-links-to-erp.md): The middleware follows the change feed and writes the GS1 Digital Link and the passport status to the serial number record in the ERP, so labels and delivery papers carry it. Key scopes: read
- [Returns and repairs as lifecycle events](https://passport.kabin.sh/docs/en/integrations/workflows/returns-and-repairs.md): Completed repairs, inspections and component replacements from service or return orders appear as events in the unit's history. Key scopes: read, condition
- [Product change leads to a new model version](https://passport.kabin.sh/docs/en/integrations/workflows/product-change.md): A change to the product master in the ERP triggers a notification; a member creates a new model version in BatteryPass. Declared data is never written automatically. Key scopes: read
