Skip to main content

Import ISO 8583 card messages

ISO 8583 is the message standard behind card transactions: an ATM withdrawal, a point-of-sale authorization, a reversal, a network echo. On the wire a message is a four-digit Message Type Indicator (MTI), one or two bitmaps that flag which of the 128 numbered data elements follow, and the elements themselves, each cut by its type and length. The ISO 8583 importer (iso8583) reads the documented field-map form of such a message — the MTI plus its data elements as JSON — into the Catalog, decodes the MTI, derives the bitmaps, and records the definition so it can be searched, versioned, diffed and linted like any other catalog item.

What you can import​

A JSON object with an mti and a dataElements (or data_elements) map keyed by data element number. Each element names its type, length and a sample value:

{
"mti": "0100",
"name": "Authorization Request",
"dataElements": {
"2": { "name": "Primary Account Number", "type": "n", "length": "..19", "value": "4111111111111111" },
"3": { "name": "Processing Code", "type": "n", "length": "6", "value": "000000" },
"11": { "name": "System Trace Audit Number", "type": "n", "length": "6", "value": "000001" }
}
}

Lengths are written as the standard does: a fixed length (6), ..LL for a two-digit length prefix (..19) and ...LLL for a three-digit one (...999). Types are the standard's codes: n, a, an, ans, b, z, x+n and the rest.

Import it​

  1. Go to Bring in → Catalog and click "Import to catalog" (see the import wizard).
  2. On Source, choose File and drop the document — try apiome-ui/examples/iso8583/01-authorization-0100.json — or choose Paste and paste it.
  3. On Detect & route, Apiome reports Auto-detected: ISO 8583 (iso8583) and routes it to the Catalog.
  4. On Quality, review the lint findings and click "Import".

Over the API, send the document to the import endpoints with the source kind iso8583; see Import sources. From the CLI:

apiome import iso8583 ./01-authorization-0100.json

The six examples in apiome-ui/examples/iso8583/ cover an authorization request and response, a network echo, two financial requests and a reversal advice, with primary and secondary bitmaps.

What Apiome reads​

In the documentBecomes
The message as a wholeA record type named after the MTI, Message0100, with one field per data element, numbered by the data element number (DE2 is field 2, DE128 field 128)
Each data elementA record type named DE<n>, with its name, type and length recorded (iso8583_de_name, iso8583_de_type, iso8583_de_length)
The mtiDecoded and recorded as iso8583_mti_decoded: the ISO 8583 release (0 = 1987, 1 = 1993, 2 = 2003), the class (1 authorization, 2 financial, 4 reversal, 8 network management …), the function (0 request, 1 response, 2 advice …) and the origin, with a summary such as Authorization request (acquirer)
The data elements presentThe bitmaps they imply, recorded as iso8583_bitmap: the primary bitmap as 16 hex digits, the secondary bitmap when any element above 64 is present (bit 1 of the primary is then set), and the element numbers
Sample valuesKept as each field's default and in the stored source; they are samples, not the contract

Versions and changes​

Import a newer definition of the same message into the same item to add a version. Because fields are numbered by data element, the comparison grades every change with ISO 8583 semantics:

ChangeSeverityRule
The MTI changedBreaking: it is another messageiso8583.mti-changed
A data element removedBreaking: counterparties on the old definition still set its bit and send itiso8583.de-removed
A data element addedDangerous: counterparties on the old definition never set its bitiso8583.de-added
A data element's length changedBreaking: the wire no longer cuts where it didiso8583.de-length-changed
A data element's type changedBreakingiso8583.de-type-changed
Only a data element's descriptive name changedSafeiso8583.de-renamed
Only a sample value changedSafeiso8583.sample-value-changed

Lint​

The Quality step and the item's Lint & score tab add the iso8583 rules on top of the common ones:

RuleSeverityFlags
iso8583.mti-knownWarningAn MTI digit the standard reserves (class 0 or 9, function 8 or 9, an unknown version or origin)
iso8583.de-number-validErrorA data element number outside 2–128
iso8583.de-type-knownWarningA type that is not an ISO 8583 type code
iso8583.de-length-declaredWarningA data element with no length
iso8583.stan-presentWarningNo DE 11 (System Trace Audit Number): a response cannot be matched to its request
iso8583.response-code-on-responseWarningA response or acknowledgement without DE 39 (Response Code)
iso8583.transmission-datetime-presentInfoNo DE 7 (Transmission Date and Time)

Export​

An ISO 8583 item writes back out as the same field-map JSON through the ISO 8583 target; see Export a spec. The binary wire form is not written.

When an import is refused​

CodeWhyWhat to do
INPUT_SYNTAX_INVALIDThe JSON is malformed or truncatedPaste the complete document
INPUT_SEMANTIC_INVALIDA data element has no value, or the document has no data elementsGive every element a sample value
FORMAT_MISMATCHThe document has no four-digit mti or no dataElements mapAdd the MTI and the element map