Swift JMT (Json Message Type)

Using JSON as a message type to improve quality and speed

We all know that there are several Swift Message Types that are confusing and each MT has a different way of processing the content of the files, in order to create a true standard simple way of communication we need to have JSON.

Why? Each MT can have 5 message blocks, let's see an example of a swift message!

{1:F01SOGEFRPPAXXX0070970817}{2:O1031734150713DEUTDEFFBXXX00739698421607131634N}{3:{103:TGT}{108:OPTUSERREF16CHAR}}{4:
:20:UNIQUEREFOFTRX16
:23B:CRED
:32A:180724EUR735927,75
:33B:EUR735927,75
:50A:/DE37500700100950596700
DEUTDEFF
:59:/FR7630003034950005005419318
CHARLES DUPONT COMPANY
RUE GENERAL DE GAULLE, 21
75013 PARIS
:71A:SHA
-}{5:{CHK:D628FE0165A7}}

 What if this could be as "simple" as:

{  
   "BasicHeader":{  
      "mandatory":true,
      "AppID":{  
         "content":"F",
         "options":"1a",
         "mandatory":true
      },
      "ServiceID":{  
         "content":"01",
         "options":"2n",
         "mandatory":true
      },
      "LTAddress":{  
         "content":"BANKFRPPAXXX",
         "options":"12x",
         "mandatory":true
      },
      "SessionNumber":{  
         "content":"4321",
         "options":"4n",
         "mandatory":true
      },
      "SequenceNumber":{  
         "content":"123456",
         "options":"6n",
         "mandatory":true
      }
   },
   "ApplicationHeaderInput":{  
      "mandatory":false,
      "InputOutputID":{  
         "content":"I",
         "options":"1a",
         "mandatory":true
      },
      "SWIFTMessageType":{  
         "content":"103",
         "options":"3n",
         "mandatory":true
      },
      "DestinationAddress":{  
         "content":"BANKFRPPAXXX",
         "options":"12x",
         "mandatory":true
      },
      "Priority":{  
         "content":"U",
         "options":"1a",
         "mandatory":false
      },
      "DeliveryMonitoring":{  
         "content":"3",
         "options":"1x",
         "mandatory":false
      },
      "ObsolescencePeriod":{  
         "content":"003",
         "options":"3n",
         "mandatory":false
      }
   },
   "ApplicationHeaderOutput":{  
      "mandatory":false,
      "InputOutputID":{  
         "content":"O",
         "options":"1a",
         "mandatory":true
      },
      "SWIFTMessageType":{  
         "content":"103",
         "options":"3n",
         "mandatory":true
      },
      "InputTime":{  
         "content":"2212",
         "options":"HHMM",
         "mandatory":true
      },
      "MessageInputReference":{  
         "content":{  
            "SenderDate":{  
               "content":"180711",
               "options":"YYMMDD"
            },
            "LTAddress":{  
               "content":"BANKFRPPAXXX",
               "options":"[A-Z]{4}[A-Z]{2}[0-9A-Z]{2}[0-9A-Z][0-9A-Z]{3}"
            },
            "SessionNumber":{  
               "content":"7635",
               "options":"4!n"
            },
            "SequenceNumber":{  
               "content":"123456",
               "options":"[0-9]{6}"
            }
         },
         "mandatory":true
      },
      "OutputDate":{  
         "content":"120910",
         "options":"YYMMDD",
         "mandatory":true
      },
      "OutputTime":{  
         "content":"1214",
         "options":"HHMM",
         "mandatory":true
      },
      "Priority":{  
         "content":"U",
         "options":"1a",
         "mandatory":false
      }
   },
   "UserHeader":{  
      "mandatory":false,
      "ServiceIdentifier":{  
         "content":"{103:EBA}",
         "options":"{103:3!a}",
         "mandatory":true
      },
      "BankingPriority":{  
         "content":"{113:xxxx}",
         "options":"{113:4!x}",
         "mandatory":false
      },
      "MessageUserReference":{  
         "content":"{108:REF0140862562/015}}",
         "options":"{108:16!x}",
         "mandatory":false
      },
      "ValidationFlag":{  
         "content":"{119:STP}",
         "options":"{119:8c}",
         "mandatory":false
      },
      "BalanceCheckpointDateAndTime":{  
         "content":"{423:18071715301204}",
         "options":"{423:YYMMDDHHMMSS[ss]}",
         "mandatory":false
      },
      "MessageInputReference":{  
         "content":{  
            "Date":{  
               "content":"120811",
               "options":"YYMMDD"
            },
            "LTIdentifier":{  
               "content":"BANKBEBBA",
               "options":"[A-Z]{4}[A-Z]{2}[0-9A-Z]{2}[0-9A-Z][0-9A-Z]{3} "
            },
            "BranchCode":{  
               "content":"XXX",
               "options":"3!c"
            },
            "SessionNumber":{  
               "content":"2222",
               "options":"4!n "
            },
            "SequenceNumber":{  
               "content":"123456",
               "options":"[0-9]{6} "
            }
         },
         "mandatory":false
      },
      "RelatedReference":{  
         "content":"{424:PQAB1234}",
         "options":"{424:16x}",
         "mandatory":false
      },
      "ServiceTypeIdentifier":{  
         "content":"",
         "options":"{111:3!n}",
         "mandatory":false
      },
      "UniqueEndToEndTransactionReference":{  
         "content":"{121:180f1e65-90e0-44d5-a49a-92b55eb3025f}",
         "options":"{121:xxxxxxxx-xxxx-4xxx-yxxxxxxxxxxxxxxx}",
         "mandatory":false
      },
      "AddresseeInformation":{  
         "content":"{115: 121413 121413 DE BANKDECDA123}",
         "options":"{115:32x}",
         "mandatory":false
      },
      "PaymentReleaseInformationReceiver":{  
         "content":"{165:/CCC/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}",
         "options":"{165:/3!c/34x}",
         "mandatory":false
      },
      "SanctionsScreeningInformationForTheReceiver":{  
         "content":"{433:/AOK}",
         "options":"{433:/3!a/[20x]}",
         "mandatory":false
      },
      "PaymentControlsInformationForReceiver":{  
         "content":"{434:/FPO}",
         "options":"{434:/3!a/[20x]}",
         "mandatory":false
      }
   },
   "Text":{  
      "mandatory":false,
      "SendersReference":{  
         "content":"CCCCCCCCCCCCCCCCCC",
         "options":"16x",
         "mandatory":true
      },
      "TimeIndication":{  
         "content":"/cccccccc/123412222",
         "options":"/8c/4!n1!x4!n",
         "mandatory":false
      },
      "BankOperationCode":{  
         "content":"CCCC",
         "options":"4!c",
         "mandatory":true
      },
      "InstructionCode":{  
         "content":"CCCC/aasaddddddddddddddddddddd",
         "options":"4!c[/30x]",
         "mandatory":false
      },
      "TransactionTypeCode":{  
         "content":"CCC",
         "options":"3!c",
         "mandatory":false
      },
      "ValueDateCurrencyInterbankSettledAmount":{  
         "content":"123456123123456789111111",
         "options":"6!n3!a15d",
         "mandatory":false
      },
      "CurrencyInstructedAmount":{  
         "content":"123123456789111111111111111",
         "options":"3!a15d",
         "mandatory":false
      },
      "ExchangeRate":{  
         "content":"123456789111",
         "options":"12d",
         "mandatory":false
      },
      "OrderingCustomer":{  
         "content":"F",
         "options":"A, F, or K",
         "mandatory":true
      },
      "SendingInstitution":{  
         "content":"F",
         "options":"[/1!a][/34x] 4!a2!a2!c[3!c]",
         "mandatory":true
      }
   },
   "Trailers":{  
      "mandatory":false,
      "Checksum":{  
         "content":"{CHK:123456789ABC}}",
         "options":"{CHK:12!h}",
         "mandatory":true
      },
      "TestTrainingMessage":{  
         "content":"{TNG:}",
         "options":"{TNG:}",
         "mandatory":false
      },
      "PossibleDuplicateEmission":{  
         "content":{  

         },
         "options":"4!c",
         "mandatory":false
      }
   }
}

As you can verify parsing this is a hell, you have to verify expressions that sometimes are not even a swift expression or regex and you have message blocks and fields that are optional.

The only way to solve this hell could be:
  • Define only one validation format - regex or swift expression
  • Use all message types in JSON - creating JMT (Json Message Type)
  • Create a framework to parse and validate JMT
  • Possibly create a framework to convert MT to JMT
  • Possibly use JWT to send message types

 

What are your thoughts about this?