ballerinax/edifact.d03a.supplychain 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 29 UN/EDIFACT D03A messages grouped under supplychain: purchase orders, changes and responses, delivery schedules and just-in-time calls, despatch and receiving advices, inventory and order status reports, party information, documentary credit messages, cargo insurance claims, and superannuation messages.

Key Features

  • Typed records for all 29 messages in the supplychain 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.supplychain 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.supplychain;
import ballerinax/edifact.d03a.supplychain.mORDERS;

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("orders.edi");
    mORDERS:EDI_ORDERS_ORDERS message =
        check supplychain:fromEdiString(ediText, supplychain:EDI_ORDERS).ensureType();
    io:println(message);
}

supplychain: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 supplychain:toEdiString(message, supplychain:EDI_ORDERS);

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
APERAKApplication error and acknowledgementedifact.d03a.supplychain.mAPERAK
DELFORDelivery scheduleedifact.d03a.supplychain.mDELFOR
DELJITDelivery just in timeedifact.d03a.supplychain.mDELJIT
DESADVDespatch adviceedifact.d03a.supplychain.mDESADV
DESTIMEquipment damage and repair estimateedifact.d03a.supplychain.mDESTIM
DMSTATData maintenance status report/queryedifact.d03a.supplychain.mDMSTAT
DOCADVDocumentary credit adviceedifact.d03a.supplychain.mDOCADV
DOCAMAAdvice of an amendment of a documentary creditedifact.d03a.supplychain.mDOCAMA
DOCAMIDocumentary credit amendment informationedifact.d03a.supplychain.mDOCAMI
DOCAMRRequest for an amendment of a documentary creditedifact.d03a.supplychain.mDOCAMR
DOCAPPDocumentary credit applicationedifact.d03a.supplychain.mDOCAPP
DOCAREResponse to an amendment of a documentary creditedifact.d03a.supplychain.mDOCARE
DOCINFDocumentary credit issuance informationedifact.d03a.supplychain.mDOCINF
ICSOLIInsurance claim solicitor's instructionedifact.d03a.supplychain.mICSOLI
IFTICLCargo insurance claimsedifact.d03a.supplychain.mIFTICL
IFTSTQInternational multimodal status requestedifact.d03a.supplychain.mIFTSTQ
INVRPTInventory reportedifact.d03a.supplychain.mINVRPT
ORDCHGPurchase order change requestedifact.d03a.supplychain.mORDCHG
ORDERSPurchase orderedifact.d03a.supplychain.mORDERS
ORDRSPPurchase order responseedifact.d03a.supplychain.mORDRSP
OSTENQOrder status enquiryedifact.d03a.supplychain.mOSTENQ
OSTRPTOrder status reportedifact.d03a.supplychain.mOSTRPT
PARTINParty informationedifact.d03a.supplychain.mPARTIN
RECADVReceiving adviceedifact.d03a.supplychain.mRECADV
RECECOCredit risk coveredifact.d03a.supplychain.mRECECO
STLRPTSettlement transaction reportingedifact.d03a.supplychain.mSTLRPT
SUPCOTSuperannuation contributions adviceedifact.d03a.supplychain.mSUPCOT
SUPMANSuperannuation maintenanceedifact.d03a.supplychain.mSUPMAN
SUPRESSupplier responseedifact.d03a.supplychain.mSUPRES

Import

import ballerinax/edifact.d03a.supplychain;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: 70

Current verison: 1


Weekly downloads


Source repository


Keywords

supply chain

orders

procurement

EDI

EDIFACT

D03A

B2B

Business Management/ERP

Cost/Free

Vendor/Other

Area/ERP & Business Operations

Type/Library

Name/EDIFACT D03A Supply Chain


Contributors