ballerinax/edifact.d03a.shipping Ballerina library

1.0.0

Overview

UN/EDIFACT is the United Nations standard for electronic data interchange, used to exchange business documents such as orders, invoices and despatch advices between trading partners.

This package provides Ballerina record types and parser functions for the 34 UN/EDIFACT D03A messages grouped under shipping: container announcement, release, gate-in/gate-out, discharge/loading and stuffing/stripping messages, bayplan and stowage plans, equipment stock and special handling orders, customs declarations, cargo reports and responses, and contract tendering and valuation messages.

Key Features

  • Typed records for all 34 messages in the shipping group, each in its own submodule, so a program only pulls in the records for the messages it handles.
  • Envelope-aware parsing and serialization: an interchange is read from UNB through UNZ, including the UNH/UNT message header and trailer.
  • Round-trips in both directions — EDI text to records, and records back to conformant EDI text with the UNT segment count recomputed.
  • Generated from the UN/EDIFACT D03A directory with the Ballerina EDI tool, so the records follow the published specification.

Quickstart

To use the edifact.d03a.shipping package in your Ballerina application, modify the .bal file as follows:

Step 1: Import the module

Import the package and the submodules for the messages you handle.

Copy
import ballerina/io;
import ballerinax/edifact.d03a.shipping;
import ballerinax/edifact.d03a.shipping.mBAPLIE;

Step 2: Read an EDI message

Convert an EDIFACT interchange into a Ballerina record.

Copy
public function main() returns error? {
    string ediText = check io:fileReadString("baplie.edi");
    mBAPLIE:EDI_BAPLIE_BAPLIE message =
        check shipping:fromEdiString(ediText, shipping:EDI_BAPLIE).ensureType();
    io:println(message);
}

shipping:getEDINames() returns every message name this package supports. interchangeFromEdiString gives access to the full UNB/UNZ interchange, and headersFromEdiString reads just the headers.

Step 3: Write an EDI message

Convert a Ballerina record back into an EDIFACT interchange.

Copy
string ediText = check shipping:toEdiString(message, shipping:EDI_BAPLIE);

Use interchangeToEdiString to write the full interchange rather than the message body alone.

Step 4: Run the Ballerina application

Copy
bal run

Supported messages

MessageDescriptionModule
BAPLIEBayplan/stowage plan occupied and empty locationsedifact.d03a.shipping.mBAPLIE
COACSUCommercial account summaryedifact.d03a.shipping.mCOACSU
COARRIContainer discharge/loading reportedifact.d03a.shipping.mCOARRI
CODECOContainer gate-in/gate-out reportedifact.d03a.shipping.mCODECO
CODENOPermit expiration/clearance ready noticeedifact.d03a.shipping.mCODENO
COEDORTransport equipment stock and profile reportedifact.d03a.shipping.mCOEDOR
COHAORContainer special handling orderedifact.d03a.shipping.mCOHAOR
COLREQRequest for a documentary collectionedifact.d03a.shipping.mCOLREQ
COMDISCommercial disputeedifact.d03a.shipping.mCOMDIS
CONAPWAdvice on pending worksedifact.d03a.shipping.mCONAPW
CONDPVDirect payment valuationedifact.d03a.shipping.mCONDPV
CONDRADrawing administrationedifact.d03a.shipping.mCONDRA
CONDRODrawing organisationedifact.d03a.shipping.mCONDRO
CONESTEstablishment of contractedifact.d03a.shipping.mCONEST
CONITTInvitation to tenderedifact.d03a.shipping.mCONITT
CONPVAPayment valuationedifact.d03a.shipping.mCONPVA
CONQVAQuantity valuationedifact.d03a.shipping.mCONQVA
CONRPWResponse of pending worksedifact.d03a.shipping.mCONRPW
CONTENTenderedifact.d03a.shipping.mCONTEN
CONWQDWork item quantity determinationedifact.d03a.shipping.mCONWQD
COPARNContainer announcementedifact.d03a.shipping.mCOPARN
COPAYMContributions for paymentedifact.d03a.shipping.mCOPAYM
COPINOContainer pre-notificationedifact.d03a.shipping.mCOPINO
COPRARContainer discharge/loading orderedifact.d03a.shipping.mCOPRAR
COREORContainer release orderedifact.d03a.shipping.mCOREOR
COSTCOContainer stuffing/stripping confirmationedifact.d03a.shipping.mCOSTCO
COSTORContainer stuffing/stripping orderedifact.d03a.shipping.mCOSTOR
CUSCARCustoms cargo reportedifact.d03a.shipping.mCUSCAR
CUSDECCustoms declarationedifact.d03a.shipping.mCUSDEC
CUSEXPCustoms express consignment declarationedifact.d03a.shipping.mCUSEXP
CUSPEDPeriodic customs declarationedifact.d03a.shipping.mCUSPED
CUSREPCustoms conveyance reportedifact.d03a.shipping.mCUSREP
CUSRESCustoms responseedifact.d03a.shipping.mCUSRES
VESDEPVessel departureedifact.d03a.shipping.mVESDEP

Import

import ballerinax/edifact.d03a.shipping;Copy

Other versions

Metadata

Released date: 5 days ago

Version: 1.0.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.12.0

GraalVM compatible: Yes


Pull count

Total: 23

Current verison: 0


Weekly downloads


Source repository


Keywords

shipping

container

customs

EDI

EDIFACT

D03A

B2B

Business Management/ERP

Cost/Free

Vendor/Other

Area/ERP & Business Operations

Type/Library

Name/EDIFACT D03A Shipping


Contributors