Skip to content

Developer Interface

This page is for AL developers and integrators who create DPD Austria labels without the Create Label Dialog: from their own AL code through the hub, or from an external system through the merchantCENTRAL Integration API. It is not required for normal use of the app.

Both routes take the same path as the dialog: licence check, product resolution, tracking entry and the hub events all apply.

Object Purpose
ALN MC Shipment Mgmt. (hub, codeunit 73334603) Carrier-neutral hub entry point, also used by the REST API
ALN MCDPDAT MC Integration (codeunit 73335436) Connector logic; receives the service selection and publishes the DPD Austria events
ALN MCDPDAT Additional Service (enum 73335432) The service codes of the additional services
ALN MCDPDAT Label Service (table 73335427) Additional services per label

Label from code

A label without particular services takes one hub procedure, exactly like the Create Label (1-Click) action on the sales order. CreateLabelWithDetails accepts additional services as a hub service selection (ALN MC Label Svc. Selection); the Service Code is the name of the enum value in ALN MCDPDAT Additional Service, spelled exactly like that:

var
    ShipmentMgmt: Codeunit "ALN MC Shipment Mgmt.";
    TempShipToOverrides: Record "ALN MC Shipment Label" temporary;
    TempLabelSvcSelection: Record "ALN MC Label Svc. Selection" temporary;
    EntryNo: Integer;
begin
    AddService(TempLabelSvcSelection, 'Predict', '', '');
    AddService(TempLabelSvcSelection, 'HigherInsurance', Format(2500, 0, 9), '');

    EntryNo := ShipmentMgmt.CreateLabelWithDetails(
        'DPDAT', 'SO-2026-01187', 1850, 'NP', TempShipToOverrides, TempLabelSvcSelection);
end;

local procedure AddService(var TempLabelSvcSelection: Record "ALN MC Label Svc. Selection" temporary; ServiceCode: Text[50]; Parameter1: Text[50]; Parameter2: Text[50])
begin
    TempLabelSvcSelection.Init();
    TempLabelSvcSelection."Entry No." := TempLabelSvcSelection.Count() + 1;
    TempLabelSvcSelection."Provider Code" := 'DPDAT';
    TempLabelSvcSelection."Service Code" := ServiceCode;
    TempLabelSvcSelection."Parameter 1 Value" := Parameter1;
    TempLabelSvcSelection."Parameter 2 Value" := Parameter2;
    TempLabelSvcSelection.Selected := true;
    TempLabelSvcSelection.Insert();
end;

CreateLabelFromShipmentWithDetails works the same way but expects the number of a posted sales shipment.

Return value and errors

  • The return value is the Entry No. of the ALN MC Shipment Label record.
  • A provider or licence problem raises Error(); no label is created.
  • A failed DPD call does not raise an error. The label then has Status = Error and the DPD message is stored in Error Message.
  • A Service Code the enum does not know ends the call with an error.

Service codes

The connector subscribes to the hub event OnApplyLabelServiceSelections and creates one ALN MCDPDAT Label Service record per selected entry. Of these, only two services are transmitted to the DPD interface:

code Service Parameter 1 Parameter 2 Note
Predict Predict by email Address from the ship-to address; without an email address on the document the service has no effect
HigherInsurance Higher insurance Amount Empty = default amount of the DPD Austria setup

Do not send the other enum values

The remaining values of the enum (StoragePermission, IdentCheck, DepartmentDelivery, Aviso, CashOnDelivery, ValuableParcel, ExchangeService, ConstructionSite, Unfree, LimitedQuantity) are stored on the label but not passed to the DPD interface, neither from the dialog nor from the API. The label is then created without the service and without an error message.

Default service and amount format

If the service selection contains at least one DPD Austria entry, the default Predict of the setup is not applied; only an empty selection gets it. The amount of HigherInsurance is read with Evaluate in the number format of the session. In AL, Format(Amount, 0, 9) produces the right format. Through the REST API the session runs under the language of the Microsoft Entra application: create that application with language English and send 2500.00. A German session would read 2500.00 as 250000.


Through the Integration API

The hub REST API passes the services in the servicesJson field of a label request. The same codes and rules as above apply:

{
  "salesOrderNo": "SO-2026-01187",
  "providerCode": "DPDAT",
  "productCode": "NP",
  "weightGrams": 1850,
  "servicesJson": "[{\"code\":\"Predict\"},{\"code\":\"HigherInsurance\",\"parameter1\":\"2500.00\"}]"
}

Endpoints, fields and authentication are described in the API Reference.


Events

Hub (ALN MC Shipment Evt Publisher, codeunit 73334602)

Event When
OnAfterCreateShipmentLabel Label created successfully, tracking entry written
OnCreateShipmentLabelError DPD call failed, label stored with status Error
OnAfterCancelShipment Shipment cancelled
OnAfterDeliveryStatusChanged Delivery status changed by tracking

DPD Austria (ALN MCDPDAT MC Integration, codeunit 73335436)

Event When
OnBeforeCreateDPDATLabel Before request building, IsReturn marks return labels, IsHandled replaces the default route
OnAfterCreateDPDATLabel After a successful DPD response

Notes

  • Licence. Both routes check the DPD Austria licence like the dialog does. Without an active licence or demo no label is created.
  • Permissions. The calling user needs the permission set ALN MCDPDAT User or the execute rights on the codeunits it contains.