Build & Parse ISO8583 Messages in Node.js with iso8583-lite 🚀
If you’ve ever worked in fintech, banking, or payment gateways, you know how important ISO8583 messages are. These messages power almost every card-based transaction globally.
But creating and parsing them manually? Tedious, error-prone, and time-consuming.
That’s why I built iso8583-lite
— a lightweight, fast Node.js library that makes building and parsing ISO8583 messages a breeze.
Why iso8583-lite?
✅ Simple API for building and parsing ISO8583 messages
✅ Supports MTI and field-level handling
✅ Perfect for testing, mocking, or real transaction processing
✅ Lightweight and dependency-free
Installation
Using npm;
npm install iso8583-lite
Using yarn;
yarn add iso8583-lite
Build a Message
import ISO8583 from "iso8583-lite";
const iso = new ISO8583();
iso.setMTI("0200"); // Financial transaction request
iso.setField(2, "1234567890123456"); // Primary account number
iso.setField(3, "000000"); // Processing code
iso.setField(4, "1000"); // Transaction amount
iso.setField(7, "20251009123000"); // Transmission date & time
const builtMessage = iso.build();
console.log("Built ISO8583 Message:", builtMessage);
OUTPUT
02007200000000000000161234567890123456060000000410001420251009123000
Parse a Message
const incoming = "02007200000000000000161234567890123456060000000410001420251009123000";
iso.parse(incoming);
console.log("Parsed MTI:", iso.getMTI());
console.log("Parsed Fields:", {
2: iso.getField(2),
3: iso.getField(3),
4: iso.getField(4),
7: iso.getField(7)
});
Output:
Parsed MTI: 0200
Parsed Fields: { '2': '1234567890123456', '3': '000000', '4': '1000', '7': '20251009123000' }
Top comments (0)