Download OpenAPI specification:Download
The EDI Engine API offers GET and POST methods to request operational business data - converted from EDI messages received from partners - or to import data into EDI Engine to generate EDI messages.
This API reference explains each of the API endpoints, with example REST requests and responses included.
To use the EDI Engine API, you need to include a token, EDI mail box and application id with each call.
Before starting to use the EDI Engine APIs, operational events need to be mapped to EDI event types.
Mail systems define their own operational events, which can be associated with EDI event types. EDI engine allows to define mapping between these two types of events so that mail systems can extract or send business data based on operational events. The mapping can be defined only between events that are associated with the same type of mail unit types:
| Mail unit type code | Description |
|---|---|
MI |
Mail item |
RC |
Receptacle |
DP |
Dispatch |
CS |
Consignment |
CR |
Customs response / Referral |
CT |
Container |
PP |
Postal payment |
RS |
Referral response |
Examples of possible mapping entries:
1 shall trigger EMSEVT EMA message130 shall trigger RESCON and RESDES messagesThe event mapping configuration API allows to map one or more operational events to one same EDI event type. The following mapping allows to generate
EMSEVT EMD event for two different operational events:
30 operational event - EMSEVT EMD event42 operational event - EMSEVT EMD eventIn order to convert incoming EDI events to operational events, the event mapping configuration API allows to map one EDI event type to one operational event type.
The parameter preferredReverseMapping is set to true to define the reverse mapping.
Access to this method is authorized by token.
The mapping does not allow to specify EDI message version.
| applicationId required | string A specific string defined for country |
| address required | string EDI mailbox address (like NL330). If operator has several mailbox addresses one can be configured in the system |
Array of objects (MappingData) Array that has all mapping data |
{- "mapping": [
- {
- "code": "1",
- "name": "Receive item from customer",
- "mailUnitType": "MI",
- "ediEvent": "EMA",
- "mailFlow": "O",
- "valid": true,
- "preferredReverseMapping": true
}
]
}{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": null
}Retrieves a list of mail items' business data - converted from imported EMSEVT messages - based on query parameters
Access to this method is authorized by token.
| itemIdentifier | string Example: itemIdentifier=RU993618685NL Specifies the unique identifier of a mail item. When provided, only the data associated with this specific mail item will be retrieved. |
| events | Array of strings Example: events=["1", "8", "30"] A list of operational events that client is interested in |
| localDateFrom required | string <date-time> Example: localDateFrom=2024-02-29T13:20:00 Specifies local date and time on or after operational events recorded |
| localDateTo | string <date-time> Example: localDateTo=2024-02-29T13:30:00 Specifies local date and time on or before operational events recorded |
| timeOffset | number <double> Example: timeOffset=1 Time zone value between local time and UTC time |
| applicationId required | string A specific string defined for country |
| address required | string EDI mailbox address (like NL330). If operator has several mailbox addresses one can be configured in the system |
{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": {
- "mailItems": [
- {
- "itemIdentifier": "EA063523423CH",
- "originCountry": "CH",
- "itemOriginOperator": "CHA",
- "itemDestinationOperator": "NZA",
- "destinationCountry": "NZ",
- "mailClass": "E",
- "productType": null,
- "customerAccountNumber": null,
- "originPostcode": "3005",
- "collectionPostcode": "3015",
- "networkEntryLocationType": 1,
- "itemLodgmentMode": 3,
- "itemCategory": null,
- "itemSubclass": "UA",
- "itemHandlingClass": null,
- "dutiableIndicator": "100",
- "customerChargingArrangement": null,
- "addressSection": {
- "placeOfOrigin": "Bern",
- "postcode": "0600",
- "placeOfDestination": "Auckland",
- "deliveryLocationType": "DS1",
- "houseIdentifier": "100a",
- "line1": "Wellington street",
- "line2": null,
- "consumerRegistrationNumber": null,
- "pickUpPointId": "Z Waiuku",
- "deliveryServiceType": null
}, - "senderInformation": {
- "telephone": "+41 123 45 56",
- "email": "sender@email.ch"
}, - "addresseeInformation": {
- "telephone": "+64 987 65 43",
- "email": "addressee@email.co.nz",
- "name": "John Doe",
- "language": "ENG"
}, - "measureInformation": {
- "grossWeight": 15.34,
- "netWeight": 12.45,
- "volume": 8.55
}, - "postagePaidInformation": {
- "amount": 25.65,
- "currency": "CHF"
}, - "cashOnDelivery": {
- "amount": null,
- "currency": null,
- "bic": null,
- "iban": null
}, - "alternativeAddress": {
- "cityTown": null,
- "houseIdentifier": null,
- "line1": null,
- "line2": null,
- "postcode": null
}, - "itemEvents": [
- {
- "operationalEventCode": "1",
- "eventTimeStamp": "2019-08-24T14:15:22Z",
- "eventOfficeOfExchange": null,
- "eventLocalOffice": "Burgernziel",
- "customsData": {
- "customsFacilityType": null,
- "customsRetentionReason": null,
- "customsOfficeID": null,
- "customsReleaseStatus": null
}, - "signatureName": null,
- "deliveryLocation": null,
- "itemArrivalStatus": null,
- "itemArrivalDirection": null,
- "processingPoint": {
- "processingPointID": "CHBRNA",
- "processingPointType": "SOR",
- "processingPointPostcode": null
}, - "exportFlow": null,
- "despatchOffice": null,
- "despatchId": null,
- "receptacleId": null,
- "reasonForReturn": null,
- "mailSource": null,
- "itemDeliveryType": null,
- "actionTaken": null,
- "actionReason": null
}
]
}
]
}
}Imports mail item data.
Access to this method is authorized by token.
IIS limits the packet size; therefore: it is not recommented to include more than 200 mail items' data in a single call.
| applicationId required | string A specific string defined for country |
| address required | string EDI mailbox address (like NL330). If operator has several mailbox addresses one can be configured in the system |
Array of objects (MailItemData) |
{- "mailItems": [
- {
- "itemIdentifier": "EA063523423CH",
- "originCountry": "CH",
- "itemOriginOperator": "CHA",
- "itemDestinationOperator": "NZA",
- "destinationCountry": "NZ",
- "mailClass": "E",
- "productType": null,
- "customerAccountNumber": null,
- "originPostcode": "3005",
- "collectionPostcode": "3015",
- "networkEntryLocationType": 1,
- "itemLodgmentMode": 3,
- "itemCategory": null,
- "itemSubclass": "UA",
- "itemHandlingClass": null,
- "dutiableIndicator": "100",
- "customerChargingArrangement": null,
- "addressSection": {
- "placeOfOrigin": "Bern",
- "postcode": "0600",
- "placeOfDestination": "Auckland",
- "deliveryLocationType": "DS1",
- "houseIdentifier": "100a",
- "line1": "Wellington street",
- "line2": null,
- "consumerRegistrationNumber": null,
- "pickUpPointId": "Z Waiuku",
- "deliveryServiceType": null
}, - "senderInformation": {
- "telephone": "+41 123 45 56",
- "email": "sender@email.ch"
}, - "addresseeInformation": {
- "telephone": "+64 987 65 43",
- "email": "addressee@email.co.nz",
- "name": "John Doe",
- "language": "ENG"
}, - "measureInformation": {
- "grossWeight": 15.34,
- "netWeight": 12.45,
- "volume": 8.55
}, - "postagePaidInformation": {
- "amount": 25.65,
- "currency": "CHF"
}, - "cashOnDelivery": {
- "amount": null,
- "currency": null,
- "bic": null,
- "iban": null
}, - "alternativeAddress": {
- "cityTown": null,
- "houseIdentifier": null,
- "line1": null,
- "line2": null,
- "postcode": null
}, - "itemEvents": [
- {
- "operationalEventCode": "1",
- "eventTimeStamp": "2019-08-24T14:15:22Z",
- "eventOfficeOfExchange": null,
- "eventLocalOffice": "Burgernziel",
- "customsData": {
- "customsFacilityType": null,
- "customsRetentionReason": null,
- "customsOfficeID": null,
- "customsReleaseStatus": null
}, - "signatureName": null,
- "deliveryLocation": null,
- "itemArrivalStatus": null,
- "itemArrivalDirection": null,
- "processingPoint": {
- "processingPointID": "CHBRNA",
- "processingPointType": "SOR",
- "processingPointPostcode": null
}, - "exportFlow": null,
- "despatchOffice": null,
- "despatchId": null,
- "receptacleId": null,
- "reasonForReturn": null,
- "mailSource": null,
- "itemDeliveryType": null,
- "actionTaken": null,
- "actionReason": null
}
]
}
]
}{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": null
}Retrieves customs declaration business data - converted from imported ITMATT messages - based on query parameters
Access to this method is authorized by token.
| itemIdentifier | string Example: itemIdentifier=CP163815968CH S10 item identifier. If specified, customs declarations data only for this identifier will be retrieved. |
| localDateFrom | string <date-time> Example: localDateFrom=2024-02-29T13:20:00 Specifies local date and time on or after customs declaration data recorded |
| localDateTo | string <date-time> Example: localDateTo=2024-02-29T13:30:00 Specifies local date and time on or before customs declaration data recorded |
| timeOffset | number <double> Example: timeOffset=1 Time zone value between local time and UTC time |
{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": {
- "customsDeclarations": [
- {
- "itemIdentifier": "CP163815968CH",
- "destinationOperator": "NLA",
- "originOperator": "CHA",
- "alternateIdentifiers": null,
- "attributeVersionNumber": 2,
- "customers": {
- "sender": {
- "identification": {
- "name": "John Smith",
- "reference": "1234567890",
- "additionalData": [
- "Office 407"
]
}, - "address": {
- "premises": {
- "line1": "Weltpoststrasse 4",
- "line2": null,
- "line3": null,
- "line4": null
}, - "countryCode": "CH",
- "city_town": "Bern",
- "postCode": "3015",
- "region": "BE"
}, - "contactDetails": {
- "emails": [
- "test_sender@upu.int"
], - "telephone": [
- "+41 123 45 67"
], - "fax": [
- "+41 123 45 68"
]
}
}, - "addressee": {
- "identification": {
- "name": "Ann Dupont",
- "reference": "99567890",
- "additionalData": [
- "HR department"
]
}, - "address": {
- "premises": {
- "line1": "Agnietenstraat 100a",
- "line2": null,
- "line3": null,
- "line4": null
}, - "countryCode": "NL",
- "city_town": "Gouda",
- "postCode": "2801",
- "region": "GZ"
}, - "contactDetails": {
- "emails": [
- "test_addressee@gmail.com"
], - "telephone": [
- "+31 765 54 32"
], - "fax": [
- "+31 765 54 31"
]
}
}
}, - "dangerousGood": {
- "hazardClass": null,
- "typeCode": null
}, - "declaredGrossWeight": 5.2,
- "measuredGrossWeight": 5.2,
- "insuredValue": {
- "currencyCode": "CHF",
- "amount": 50.25
}, - "postagePaidValue": {
- "currencyCode": "CHF",
- "amount": 16.95
}, - "additionalFee": {
- "currencyCode": "EUR",
- "amount": 5.99
}, - "customsTaxInformation": {
- "natureOfTransaction": {
- "code": "11",
- "description": null
}, - "customsProcedure": null,
- "totalDeclaredValue": {
- "currencyCode": "CHF",
- "amount": 5.2
}, - "observations": null,
- "associatedDocuments": [
- {
- "type": "380",
- "name": null,
- "identifier": null
}
], - "contentPieces": [
- {
- "pieceNumber": 1,
- "pieceNumberOfUnits": 3,
- "description": "Swiss chocolades",
- "declaredValue": {
- "currencyCode": "CHF",
- "amount": 5.2
}, - "netWeight": 5,
- "originLocationCode": "CH",
- "tariffHeading": "9999999999"
}
]
}, - "eventData": {
- "code": "XP",
- "dateTime": "2019-08-24T14:15:22Z",
- "location": {
- "code": "CH BRN",
- "function": "4"
}, - "associatedEntity": {
- "identifier": "CHZRHBNLHAGIACN50502009000196"
}, - "status": null,
- "reason": null
}
}
]
}
}Imports customs declaration data.
Access to this method is authorized by token.
IIS limits the packet size; therefore: it is not recommented to include more than 200 customs declaration data in a single call.
Array of objects (CustomsDeclarationData) |
{- "customsDeclarations": [
- {
- "itemIdentifier": "CP163815968CH",
- "destinationOperator": "NLA",
- "originOperator": "CHA",
- "alternateIdentifiers": null,
- "attributeVersionNumber": 2,
- "customers": {
- "sender": {
- "identification": {
- "name": "John Smith",
- "reference": "1234567890",
- "additionalData": [
- "Office 407"
]
}, - "address": {
- "premises": {
- "line1": "Weltpoststrasse 4",
- "line2": null,
- "line3": null,
- "line4": null
}, - "countryCode": "CH",
- "city_town": "Bern",
- "postCode": "3015",
- "region": "BE"
}, - "contactDetails": {
- "emails": [
- "test_sender@upu.int"
], - "telephone": [
- "+41 123 45 67"
], - "fax": [
- "+41 123 45 68"
]
}
}, - "addressee": {
- "identification": {
- "name": "Ann Dupont",
- "reference": "99567890",
- "additionalData": [
- "HR department"
]
}, - "address": {
- "premises": {
- "line1": "Agnietenstraat 100a",
- "line2": null,
- "line3": null,
- "line4": null
}, - "countryCode": "NL",
- "city_town": "Gouda",
- "postCode": "2801",
- "region": "GZ"
}, - "contactDetails": {
- "emails": [
- "test_addressee@gmail.com"
], - "telephone": [
- "+31 765 54 32"
], - "fax": [
- "+31 765 54 31"
]
}
}
}, - "dangerousGood": {
- "hazardClass": null,
- "typeCode": null
}, - "declaredGrossWeight": 5.2,
- "measuredGrossWeight": 5.2,
- "insuredValue": {
- "currencyCode": "CHF",
- "amount": 50.25
}, - "postagePaidValue": {
- "currencyCode": "CHF",
- "amount": 16.95
}, - "additionalFee": {
- "currencyCode": "EUR",
- "amount": 5.99
}, - "customsTaxInformation": {
- "natureOfTransaction": {
- "code": "11",
- "description": null
}, - "customsProcedure": null,
- "totalDeclaredValue": {
- "currencyCode": "CHF",
- "amount": 5.2
}, - "observations": null,
- "associatedDocuments": [
- {
- "type": "380",
- "name": null,
- "identifier": null
}
], - "contentPieces": [
- {
- "pieceNumber": 1,
- "pieceNumberOfUnits": 3,
- "description": "Swiss chocolades",
- "declaredValue": {
- "currencyCode": "CHF",
- "amount": 5.2
}, - "netWeight": 5,
- "originLocationCode": "CH",
- "tariffHeading": "9999999999"
}
]
}, - "eventData": {
- "code": "XP",
- "dateTime": "2019-08-24T14:15:22Z",
- "location": {
- "code": "CH BRN",
- "function": "4"
}, - "associatedEntity": {
- "identifier": "CHZRHBNLHAGIACN50502009000196"
}, - "status": null,
- "reason": null
}
}
]
}{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": null
}This API method enables postal operators and customs authorities to retrieve scheduled arrival details for cargo consignments and the mail items they contain.
| capturedTimeStampFrom required | string <date-time> Example: capturedTimeStampFrom=2025-06-01T13:20:00 Specifies UTC date and time on or after cargo consignments information was recorded |
| capturedTimeStampTo | string <date-time> Example: capturedTimeStampTo=2025-06-01T15:20:00 Specifies UTC date and time before cargo consignments information was recorded |
| senderReferenceNo | string Identifier of the sender of the cargo consignment (e.g., EORI number for shipments into EU) |
| billNo | string Example: billNo=HKG123456A The identifier of the waybill / bill of lading |
| containerIdentifier | string Example: containerIdentifier=AKE12345 A unique alphanumeric identifier representing the container |
| itemIdentifier | string A mailitem identifier (S10, S26 or other) stored in container |
| transportNo | string Example: transportNo=LX1279 A full transport number |
| arrivalLocationCode | string Example: arrivalLocationCode=DEFRA Arrival location code of a segment |
| arrivalDateFrom | string Example: arrivalDateFrom=2024-02-29T10:20:00 The start of the arrival time range for filtering segments. Expressed in local time |
| arrivalDateTo | string Example: arrivalDateTo=2024-02-29T14:20:00 The end of the arrival time range for filtering segments. Expressed in local time |
{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": {
- "consignments": [
- {
- "senderReferenceNo": "example",
- "billNo": "HKG123456A",
- "capturedTimeStamp": "2024-02-29T10:20:00",
- "transportSegments": [
- {
- "transportMode": 1,
- "transportNo": "LX1279",
- "departureDate": "2024-02-29T10:20:00",
- "arrivalDate": "2024-02-29T14:20:00",
- "transportCompanyCode": "LH",
- "transportCompanyCodeSource": "LLOYD",
- "departureLocationCode": "DEFRA",
- "arrivalLocationCode": "TRIST"
}
], - "containers": [
- {
- "identifier": "AKE12345",
- "identifierSource": "BIC",
- "mailItems": [
- "RG202503101CH"
]
}
]
}
]
}
}Imports detailed information about containers and mail items included in cargo consignments.
This method is intended for use by consolidators’ IT systems and should be invoked whenever a consignment is prepared for dispatch to the destination country’s postal operator.
The method performs the following operations:
Validation Rules:
Note: Due to IIS packet size limitations, it is recommended to include no more than 200 cargo consignments in a single API call to ensure reliable processing.
Array of objects (ImportCargoConsignmentData) |
{- "cargoConsigments": [
- {
- "senderReferenceNo": "example",
- "billNo": "HKG123456A",
- "transportSegments": [
- {
- "transportMode": 1,
- "transportNo": "LX1279",
- "departureDate": "2024-02-29T10:20:00",
- "arrivalDate": "2024-02-29T14:20:00",
- "transportCompanyCode": "LH",
- "transportCompanyCodeSource": "LLOYD",
- "departureLocationCode": "DEFRA",
- "arrivalLocationCode": "TRIST"
}
], - "containers": [
- {
- "identifier": "AKE12345",
- "identifierSource": "BIC",
- "mailItems": [
- "RG202503101CH"
]
}
]
}
]
}{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": null
}Returns a list of valid transport companies configured in the system.
{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": [
- {
- "code": "LH",
- "name": "Deutsche Lufthansa Aktiengesellschaft",
- "codeSource": "IATA",
- "valid": true
}
]
}Retrieves information about a transport company for cargo transport data.
| code required | string Example: code=LH Unique code of the transport company |
{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": {
- "code": "LH",
- "name": "Deutsche Lufthansa Aktiengesellschaft",
- "codeSource": "IATA",
- "valid": true
}
}Creates a new entry in the system for a transport company involved in cargo logistics and optionally updates its validity status.
| code | string [ 1 .. 17 ] characters Unique code of the transport company (e.g., |
| name | string [ 1 .. 256 ] characters Transport company name (e.g., |
| codeSource | string [ 1 .. 8 ] characters A short identifier representing the government agency or industry organization responsible for assigning or tracking company codes used in transportation and logistics. (e.g., |
| valid | boolean Indicates whether the company is currently valid and operational. - true: The company is active and recognized as a valid entity. - false: The company is no longer valid. |
{- "code": "LH",
- "name": "Deutsche Lufthansa Aktiengesellschaft",
- "codeSource": "IATA",
- "valid": true
}{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": null
}Returns a list of valid transport locations configured in the system.
{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": [
- {
- "code": "DEFRA",
- "name": "Frankfurt",
- "codeSource": "IATA",
- "valid": true
}
]
}Retrieves information about a transport location for cargo transport data.
| code required | string Example: code=LH Unique code of the transport location |
{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": {
- "code": "DEFRA",
- "name": "Frankfurt",
- "codeSource": "IATA",
- "valid": true
}
}Imports information about location.
This method is intended to import data used in cargo consignment services.
| code | string [ 1 .. 5 ] characters Unique code of the location (e.g., |
| name | string [ 1 .. 64 ] characters Full location name (e.g., |
| codeSource | string [ 1 .. 8 ] characters A short identifier representing the government agency or industry organization responsible for assigning or tracking location codes used in transportation and logistics. (e.g., |
| valid | boolean Indicates whether the location is currently valid and operational. - true: The location is active and recognized as a valid entity. - false: The location is no longer valid. |
{- "code": "DEFRA",
- "name": "Frankfurt",
- "codeSource": "IATA",
- "valid": true
}{- "responseStatus": {
- "statusCode": 200,
- "statusMessage": "Ok"
}, - "data": null
}