Open source · MIT

@ohmyfin/swift-draft

A zero-dependency TypeScript library for drafting, validating and translating SWIFT MT (MT103/202/202COV/199) and ISO 20022 MX (pacs.008/009/002, camt.053/054) messages. Works in Node 20+ and modern browsers without polyfills. This page itself is running the library entirely client-side — no network calls.

Install

npm install @ohmyfin/swift-draft

Or drop the UMD bundle into a static page:

<script src="https://unpkg.com/@ohmyfin/swift-draft@latest/dist/swift-draft.umd.min.js"></script>
<script>
  const report = SwiftDraft.validate("MT103", { /* payload */ });
</script>

30-second example

import { serializeMt, validate } from "@ohmyfin/swift-draft";

const payload = {
  senderBic: "DEUTDEFFXXX",
  receiverBic: "NWBKGB2LXXX",
  uetr: "eb6305c9-1f7f-4def-aaee-805b6e8b3b1a",
  fields: {
    "20":  "TXN-2026-0001",
    "23B": "CRED",
    "32A": { valueDate: "260525", currency: "EUR", amount: "1234,56" },
    "50K": "/DE89370400440532013000\nACME GMBH\nBERLIN",
    "59":  "/GB82WEST12345698765432\nBETA LTD\nLONDON",
    "70":  "INVOICE 2026-0001",
    "71A": "SHA",
  },
};

if (!validate("MT103", payload).ok) throw new Error("invalid");
const fin = serializeMt("MT103", payload);

Live demo (runs in your browser, no server)

What it supports