DEV Community

Cover image for MT-To-JSON
pixelbyaj
pixelbyaj

Posted on • Edited on

MT-To-JSON

Introducing the Swift MT to JSON Converter for .NET – a powerful library designed to effortlessly transform complex Swift MT messages into structured JSON format. Built for .NET developers, this library streamlines the integration of financial messaging data into modern applications, enabling faster processing, better readability, and seamless data handling. Whether you're working on financial systems, compliance tools, or data analytics platforms, this library is your key to bridging traditional Swift MT standards with modern JSON workflows. Simplify your development and enhance your financial data management today!

Features

  • Convert Swift MT to JSON message
  • Set custom parsing rules

Live Demo

Example

Swift MT Message

{1:F01BANKBEBBAXXX1234567890}{2:O1031500100417BANKUS33XXXX22221234561004171500N}{3:{108:ILOVEFUNDSTRANSFER}}{4:
:20:1234567890123456
:23B:CRED
:32A:240917USD100000,00
:33B:USD100000,00
:50K:/12345678
JOHN DOE
123 MAIN STREET
NEW YORK, NY 10001, USA
:52A:BANKBEBBXXX
:53A:BANKDEFFXXX
:57A:BANKUS33XXX
:59:/9876543210
JANE DOE
456 OAK STREET
LOS ANGELES, CA 90001, USA
:70:/INV/123456 PURCHASE ORDER 78910
:71A:OUR
:72:/BNF/PLEASE CONFIRM UPON RECEIPT
:77B:/NOTFORFINANCIALADVICE
-}
Enter fullscreen mode Exit fullscreen mode

SWIFT MT103 RULES

{
  "20": {
    "Name": "TransactionReferenceNumber"
  },
  "23B": {
    "Name": "BankOperationCode"
  },
  "32A": {
    "Fields": [
      {
        "Name": "ValueDate",
        "FormatDate": "dd/MM/yyyy",
        "SubString": {
          "From": 0,
          "To": 6
        }
      },
      {
        "Name": "Currency",
        "SubString": {
          "From": 6,
          "To": 3
        }
      },
      {
        "Name": "InterbankSettled",
        "SubString": {
          "From": 9,
          "To": -1
        }
      }
    ]
  }
}

Enter fullscreen mode Exit fullscreen mode

Swift MT JSON Message parsed with rules

{
    "BasicHeader": {
      "MessageType": "F01",
      "SenderBIC": "BANKBEBB"
    },
    "ApplicationHeader": {
      "MessageIndicator": "Output",
      "MessageType": "103",
      "ReceiverBIC": "15001004",
      "MessagePriority": "Urgent"
    },
    "UserHeader": {
      "MessageUserReference": "ILOVEFUNDSTRANSFER"
    },
    "MessageDetails": {
      "Fields": {
        "TransactionReferenceNumber": "1234567890123456",
        "BankOperationCode": "CRED",
        "ValueDate": "17-09-2024",
        "Currency": "USD",
        "InterbankSettled": "100000,00"
      }
    },
    "Message": "{1:F01BANKBEBBAXXX1234567890}{2:O1031500100417BANKUS33XXXX22221234561004171500N}{3:{108:ILOVEFUNDSTRANSFER}}{4:\r\n:20:1234567890123456\r\n:23B:CRED\r\n:32A:240917USD100000,00\r\n:33B:USD100000,00\r\n:50K:/12345678\r\nJOHN DOE\r\n123 MAIN STREET\r\nNEW YORK, NY 10001, USA\r\n:52A:BANKBEBBXXX\r\n:53A:BANKDEFFXXX\r\n:57A:BANKUS33XXX\r\n:59:/9876543210\r\nJANE DOE\r\n456 OAK STREET\r\nLOS ANGELES, CA 90001, USA\r\n:70:/INV/123456 PURCHASE ORDER 78910\r\n:71A:OUR\r\n:72:/BNF/PLEASE CONFIRM UPON RECEIPT\r\n:77B:/NOTFORFINANCIALADVICE\r\n-}\r\n"
  }
Enter fullscreen mode Exit fullscreen mode

Swift MT JSON Message parsed without rules


{
  "BasicHeader": {
    "MessageType": "F01",
    "SenderBIC": "BANKBEBBAXX"
  },
  "ApplicationHeader": {
    "MessageIndicator": "Output",
    "MessageType": "103",
    "ReceiverBIC": "0417BANKUS3",
    "MessageDate": "150010",
    "MessagePriority": "Urgent"
  },
  "UserHeader": {
    "MessageUserReference": "ILOVEFUNDSTRANSFER"
  },
  "MessageDetails": {
    "Fields": {
      "20": "1234567890123456",
      "59": "/9876543210",
      "70": "/INV/123456 PURCHASE ORDER 78910",
      "72": "/BNF/PLEASE CONFIRM UPON RECEIPT",
      "23B": "CRED",
      "32A": "240917USD100000,00",
      "33B": "USD100000,00",
      "50K": "/12345678",
      "52A": "BANKBEBBXXX",
      "53A": "BANKDEFFXXX",
      "57A": "BANKUS33XXX",
      "71A": "OUR",
      "77B": "/NOTFORFINANCIALADVICE"
    }
  },
  "Message": "{1:F01BANKBEBBAXXX1234567890}{2:O1031500100417BANKUS33XXXX22221234561004171500N}{3:{108:ILOVEFUNDSTRANSFER}}{4:\n:20:1234567890123456\n:23B:CRED\n:32A:240917USD100000,00\n:33B:USD100000,00\n:50K:/12345678\nJOHN DOE\n123 MAIN STREET\nNEW YORK, NY 10001, USA\n:52A:BANKBEBBXXX\n:53A:BANKDEFFXXX\n:57A:BANKUS33XXX\n:59:/9876543210\nJANE DOE\n456 OAK STREET\nLOS ANGELES, CA 90001, USA\n:70:/INV/123456 PURCHASE ORDER 78910\n:71A:OUR\n:72:/BNF/PLEASE CONFIRM UPON RECEIPT\n:77B:/NOTFORFINANCIALADVICE\n-}"

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay