ISO20022 — Easy JSON [PART 3]

Suchak Jani
5 min readDec 9, 2018

Background

In this article we will discuss aspects of how to “easily convert XSD/XML to JSON”.

This is the third article in a five part series

Part One

Part Two

Part Three — This Article

Part Four

Part Five

Why do we need Standardisation in any industry ?

Manufacturing industry

Standardization is good for any industry.

We live in an interconnected world. We are communicating more with other individually and collectively,.

Same goes for manufacturing.

For example car manufacturer will have many car part suppliers.

My brother in law(Mehul Patel) is a paint manufacturer. He also, has to source many aspects of his paint manufacturing from other manufacturers, for example “paint packaging materials”.

If car parts do not fit together, then the car manufacturer is in trouble.

If paint raw materials do not have the right kind of paint packaging, then paint cannot be delivered on time.

Finance Software Industry

Software by definition is more malleable than traditional manufacturing.

What I mean is :

There is many ways a “software” could be built and delivered, depending on aspects like funds, resources and time.

The need for one software to interact with other software has increased, over time.

No longer can we assume we will deliver an isolated self sufficient hardware and software “package”, without the need to interact with other software.

This also holds true in the finance industry.

A single financial transaction goes through so many players in the industry. From Acquirers who capture the details of the payment to Automated Clearing Houses, who clear and settle the transaction.

A financial transaction, by its very nature needs to follow “standards”. This means, multiple financial institutions in the flow of a financial transaction, can interact with each other, in a clear and unambiguous way

A brief history of financial messaging standards

History of messaging standards

To understand ISO20022, let's look at a bit of history of payment standards.

STD18

This is a payments format used by UK and Ireland for years.

Have a look at this public spec from Bank of Ireland — see Appendix-1

As we see it is specified in a neat fashion. However it has a lot of custom format specific rules and is not a global standard.

ISO8583

This is an open standard used originally for card transactions.

It is pretty compact as a Standard, see Appendix-2

We do know that this can be implemented differently in different card schemes in different schemes, all over the world.

As we see it is nicely specified at the field level. However same fields may be “used” for something completely different in two different schemes.

XML ?

If we had used XML, the above formats could described, created and parsed with ease, Why ?

A lot of libraries and tools assist us with handling XML in all software languages.

ISO20022

I have worked with ISO20022 for 10+ years now.

ISO20022 was a game changer, precisely because it opened up the formats for interaction using the then popular, XML/XSD standard.

We could now, clearly define and interact with formats that were precise, unambiguous to read and technically based on open standards.

Another advantage was, each field would define the exact same aspect wherever it is implemented.

For example A “Debtor Agent” defines the exact same aspect wherever it is used.

Have a quick read here:

ISO20022 — Details

ISO20022 is a set of Meta XSD’s for Payments, Securities, Trade, Cards and FX.

See an example ISO20022 XML(“acmt.005.001.05.xml”) in Appendix-7

The file “acmt.005.001.05.xml” is taken from the public ISO20022 public website (See Appendix-3) under section “acmt — Account Management” and is a “RequestForAccountManagementStatusReportV05”.

Many organizations/schemes have taken these XSD’s and modified them to their data types.

Note Data types not Data Structures.

One example is bank codes.

For Instructing Agent : Some organizations/schemes may use “BIC’s (Bank Identifier Code)”, some others use “Routing numbers”, yet others like us in the UK use “Sortcodes”.

However the field Instructing Agent defines the exact same aspect world over

See Appendix-4 for a public spec for the european region as an example.

ISO20022 — JSON

  1. I have created a project on Github for doing this, See Appendix-5

2. It is easy to create JSON schema[acmt.005.001.05.schema.json]from XSD Schema[acmt.005.001.05.xsd]

xsd2json acmt.005.001.05.xsd > acmt.005.001.05.schema.json

See Appendix-6 XML Schema [acmt.005.001.05.xsd] and See Appendix-8 Json Schema[acmt.005.001.05.schema.json]

4. Easy to create JSON from XML files

xml2json acmt.005.001.05.sample.xml acmt.005.001.05.sample.json

See Appendix-7 XML file [ acmt.005.001.05.sample.xml] and See Appendix-9 JSON file [acmt.005.001.05.sample.json]

ISO20022 — XML/JSON size

  1. Compare XSD size to JSON Schema size
⇒  ls -l
total 144
-rw-r--r-- 1 suchakjani staff 26997 9 Dec 08:33 acmt.005.001.05.schema.json
-rw-r--r--@ 1 suchakjani staff 43248 9 Dec 07:56 acmt.005.001.05.xsd

As seen JSON Schema file is about half the size of the XSD file size.

2. Compare XML Size to JSON message size

⇒  ls -l
total 72
-rw-r--r-- 1 suchakjani staff 10213 9 Dec 09:00 acmt.005.001.05.sample.json
-rw-r--r--@ 1 suchakjani staff 21686 9 Dec 08:55 acmt.005.001.05.sample.xml

As seen JSON file is about half the size of the XML file.

Conclusion

ISO20022 JSON positive aspects as compared to XSD/XML

  1. JSON ISO20022 schemas, can convey all the same information as the ISO20022 XSD files and are around half the size.
  2. JSON ISO20022 files, convey the same information as XML files and are also around half the size.
  3. XSD to JSON schema is simple to convert

ISO20022 JSON files

  1. It is very easy to create JSON schemas and JSON XML files as seen in the project. See Appendix-5
  2. ISO20022 org, could use this simple strategy used in the sample project here in Appendix-5, to create XSD and JSON schemas together as soon as possible.
  3. This would help make ISO20022, more usable and many Financial Institutions would benefit, by being able to use JSON and/or XML messages as soon as possible.

Appendices

Appendix-1(STD18 — Bank of Ireland)

Appendix-2(ISO8583)

Appendix-3 — A ISO20022 Org platform website

Appendix-4 — A ISO20022 Specification from Europe

Appendix-5 — ISO20022-JSON sample project

Appendix-6 — Sample ISO20022 XSD file in Github

Appendix-7— Sample ISO20022 sample XML file in Github

Appendix-8 — Sample ISO20022 JSON Schema file in Github

Appendix-9— Sample ISO20022 sample JSON file in Github

--

--