> For the complete documentation index, see [llms.txt](https://docs.solutioo.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.solutioo.de/entwicklerdokumentationen-business-central-dhl-connector/dhl-connector-entwicklerdokumentation/architektur-und-prozessflusse/express-label-und-rateprozess.md).

# Express-Label- und Rateprozess

## Labelprozess

`GenerateLabel` dispatcht bei `API Service = Express` an den MyDHL-Pfad.

1. Konfiguration und Express-Account laden.
2. Empfänger-Snapshot und repräsentativen Auftrag bestimmen.
3. Box, Produktcode und normalisierte Dimensionen ermitteln.
4. Gewicht und Uploadstatus prüfen.
5. geplantes Versanddatum, Pickup, Account und Ausgabeformat setzen.
6. Shipper- und Receiver-Details aufbauen.
7. Package und Content hinzufügen.
8. Bei internationaler Route Export Declaration ergänzen.
9. Optional Empfängerbenachrichtigung hinzufügen.
10. `OnBeforeSendShipmentRequest` veröffentlichen.
11. JSON serialisieren und `/shipments` per Basic Auth aufrufen.
12. Tracking, Package Tracking und Labeldokument aus der Response speichern.
13. Labelbild erzeugen und Paket als hochgeladen markieren.
14. Label committen und optional Kartonbestand buchen.

## Erweiterungspunkt

`OnBeforeSendShipmentRequest` erhält das vollständig aufgebaute `JsonObject`, Package Header und Sales Header. Es wird nur für Express ausgelöst. Typische Nutzung ist die fachliche Auswahl eines Produktcodes oder zusätzlicher DHL-Services.

Subscriber dürfen keine Authentifizierung verwalten und sollten das Request-JSON wegen personenbezogener Daten nicht protokollieren.

## Express-Produkt

`SOUDHL Express Helper.MapProductCode` übersetzt das erweiterbare Enum `SOUDHL Express Product` in den MyDHL-Code. Ohne passende Zuordnung fällt die Helper-Codeunit auf `P` zurück.

## Export Declaration

Bei unterschiedlichem Absender- und Empfängerland wird `isCustomsDeclarable` gesetzt. Die Exportpositionen werden aus den Package Lines und deren Quell-Verkaufszeilen erzeugt, damit nur tatsächlich gepackte Mengen übertragen werden.

## Response

Verarbeitet werden:

* `shipmentTrackingNumber`
* erstes Package-`trackingNumber`
* Dokumente mit `typeCode = label`
* Encoding- und Formatangaben

Das Package-Tracking wird derzeit im Feld `DHL Routing Code` wiederverwendet.

## Live-Rateprozess

`GetRate` ist ein separater High-Level-Aufruf:

1. nur Express zulassen,
2. Account und Shipper-Adresse laden,
3. Receiver, Produkt, Versandzeit und Package-Daten aufbauen,
4. `/rates` aufrufen,
5. ersten Eintrag aus `products[0].totalPrice[0]` lesen.

Die Methode schreibt keine DHL-Tabellen. Preis und Währung werden über `var`-Parameter zurückgegeben.

## Bekannte Grenzen

* geplante Versandzeit ist derzeit `Today + 1` um 10:00 mit festem GMT+01:00-Text,
* Rate nimmt den ersten zurückgegebenen Produktpreis,
* `OnBeforeSendShipmentRequest` gilt nicht für `/rates`,
* Hintergrundprozesse müssen alle Exportdaten vorab vollständig bereitstellen.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.solutioo.de/entwicklerdokumentationen-business-central-dhl-connector/dhl-connector-entwicklerdokumentation/architektur-und-prozessflusse/express-label-und-rateprozess.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
