ballerinax/edifact.d03a.finance 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 32 UN/EDIFACT D03A messages grouped under finance: payment orders and multiple payment orders, credit and debit advices, direct debits, financial statements and balances, banking status, balance-of-payments reporting, invoicing, VAT and tax control, and insurance premium payment.

Key Features

  • Typed records for all 32 messages in the finance 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.finance 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.finance;
import ballerinax/edifact.d03a.finance.mAUTHOR;

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("author.edi");
    mAUTHOR:EDI_AUTHOR_AUTHOR message =
        check finance:fromEdiString(ediText, finance:EDI_AUTHOR).ensureType();
    io:println(message);
}

finance: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 finance:toEdiString(message, finance:EDI_AUTHOR);

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
AUTHORAuthorizationedifact.d03a.finance.mAUTHOR
BALANCBalanceedifact.d03a.finance.mBALANC
BANSTABanking statusedifact.d03a.finance.mBANSTA
BOPBNKBank transactions and portfolio transactions reportedifact.d03a.finance.mBOPBNK
BOPCUSBalance of payment customer transaction reportedifact.d03a.finance.mBOPCUS
BOPDIRDirect balance of payment declarationedifact.d03a.finance.mBOPDIR
BOPINFBalance of payment information from customeredifact.d03a.finance.mBOPINF
BUSCRDBusiness credit reportedifact.d03a.finance.mBUSCRD
CREADVCredit adviceedifact.d03a.finance.mCREADV
CREEXTExtended credit adviceedifact.d03a.finance.mCREEXT
CREMULMultiple credit adviceedifact.d03a.finance.mCREMUL
DEBADVDebit adviceedifact.d03a.finance.mDEBADV
DEBMULMultiple debit adviceedifact.d03a.finance.mDEBMUL
DEBRECDebts recoveryedifact.d03a.finance.mDEBREC
DIRDEBDirect debitedifact.d03a.finance.mDIRDEB
DIRDEFDirectory definitionedifact.d03a.finance.mDIRDEF
FINCANFinancial cancellationedifact.d03a.finance.mFINCAN
FINPAYMultiple interbank funds transferedifact.d03a.finance.mFINPAY
FINSTAFinancial statement of an accountedifact.d03a.finance.mFINSTA
INVOICInvoiceedifact.d03a.finance.mINVOIC
ISENDSIntermediary system enablement or disablementedifact.d03a.finance.mISENDS
LEDGERLedgeredifact.d03a.finance.mLEDGER
PAYEXTExtended payment orderedifact.d03a.finance.mPAYEXT
PAYMULMultiple payment orderedifact.d03a.finance.mPAYMUL
PAYORDPayment orderedifact.d03a.finance.mPAYORD
PRICATPrice/sales catalogueedifact.d03a.finance.mPRICAT
PRPAIDInsurance premium paymentedifact.d03a.finance.mPRPAID
QUOTESQuoteedifact.d03a.finance.mQUOTES
RECALCReinsurance calculationedifact.d03a.finance.mRECALC
REMADVRemittance adviceedifact.d03a.finance.mREMADV
TAXCONTax controledifact.d03a.finance.mTAXCON
VATDECValue added taxedifact.d03a.finance.mVATDEC

Import

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

Current verison: 1


Weekly downloads


Source repository


Keywords

finance

payments

banking

EDI

EDIFACT

D03A

B2B

Business Management/ERP

Cost/Free

Vendor/Other

Area/ERP & Business Operations

Type/Library

Name/EDIFACT D03A Finance


Contributors