Skip to content

A dialect for your network's messages

A dialect describes the messages a network, processor or switch actually uses: which fields exist, how long they are, how they are encoded, and what’s inside the structured ones. This walkthrough builds one for a fictional domestic scheme, ACME, and puts it to work. Budget under an hour for your own spec.

Your spec almost certainly follows ISO 8583:1987, 1993 or 2003 and changes some of it. Open Dialects, pick the version, and choose Extend this dialect. If your link is one a profile pack describes, such as Australia’s AS 2805 interchange (pack:as2805-iac), extend that one instead: it already has the fields the published specification changes. The editor opens with a working template:

id: acme
name: ACME domestic scheme
version: 1
extends: iso8583:1987@1
fields: {}

Everything you don’t mention stays as the built-in version defines it. The built-in versions are ISO 8583 as published, the same for every card: networks publish their private-field layouts only to licensees, so none ship with the Platform. A field you define replaces the built-in one for every card. To vary a field for one network’s cards, add it under networks:, as in networks: {VISA: {62: {content: ans, length: {kind: ll, max: 30}}}}.

If your team already describes the spec as a jPOS GenericPackager, use Import a jPOS packager instead. The result opens in the editor with notes on anything that didn’t carry over exactly.

Most schemes change how bytes travel, not just which fields exist:

mti: bcd # ascii, ebcdic or bcd
bitmap: binary # binary or hex
numeric: bcd # how digits travel: ascii, ebcdic or bcd
text: ebcdic # ascii or ebcdic
length_prefix: bcd # ascii, ebcdic, bcd or binary
bcd_odd_padding: left # left (0 first), right (F last) or right-zero (0 last)

A single field can differ: give it its own encoding, binary: hex, or a length.prefix.

Write each field as the spec’s field table does:

fields:
4:
name: Amount
content: n
length: {kind: ll, max: 12} # ACME sends the amount with a length
48:
name: ACME additional data
content: ans
length: {kind: lll, max: 999}
subfields:
format: tlv
lead: [{id: tcc, name: Transaction category, length: 1}]
tag_length: 2
length_digits: 2
elements:
"10": {name: Loyalty number}
"20": {name: Recurring flag}
  • content: n (digits), a, an, ans (text), b (binary, shown as hex), z (track data).
  • length: fixed with its size, or ll, lll, llll with a maximum. Lengths count digits for numbers, characters for text, and bytes for binary sent raw.
  • subfields: tlv (with leading positional parts, as Mastercard’s DE 48 has), ber-tlv (EMV), fixed (positions, as field 90), or bitmapped (as Visa’s field 126). Elements can nest.

The Check panel validates as you type, against everything the dialect extends.

Paste a message from your logs, a Wireshark hex dump or base64 into Preview. It’s read with the dialect exactly as written, even before you save it. A wrong length or encoding shows up as the exact byte where reading stops, which is usually enough to see which field is off. Sub-elements are listed under their field.

Save version stores version 1. Versions never change: to fix something, save version 2. The dialect page shows what each version changes against the one before it, or against the built-in version it extends.

  • A simulated host: choose the dialect in the host form. The host reads and writes with it; its encodings replace the wire format and version. Framing (length header, TPDU, message header) stays the host’s.

  • Rules by sub-element: in a host rule, one line per condition, such as 48.tcc=R to match recurring payments, and 48.20=Y under the response fields to set a sub-element in the answer.

  • Scenarios: a simulated host brings its dialect. For your own system, set it on the target, and address sub-elements by path. Paths need quotes in YAML:

    target: {host: switch.bank.test, port: 8583, dialect: acme@1}
    steps:
    - name: Recurring payment carries its flag back
    send: {sample: auth, paths: {"48.tcc": R, "48.10": "ABC123"}}
    expect: {fields: {39: "00"}, paths: {"48.20": "Y"}}
    save: {loyalty: "48.10"}
  • The workbench: choose the dialect under Reading options to inspect, or in the builder to build, messages in it.

Export for jPOS writes any version as a GenericPackager, noting what jPOS can’t express (network variants, sub-elements).

Some interfaces put a header of their own between the length and the MTI. JR/T 0055, UnionPay’s domestic interchange as the People’s Bank of China publishes it, uses 46 bytes: routing ids, the switch’s batch and category bytes, and a reject code. It isn’t a field, so it isn’t in a dialect: in the host form, set Message header to JR/T 0055 and give the host’s Station id and its Peer id.

  • The host answers each request with the request’s header, the ids swapped and the length set, and returns the switch’s bytes as received, as JR/T 0055 asks of an institution. Messages the host starts get a new header.
  • A scenario against the host frames its requests the same way, from the other end. For a host and port target, give message_header: jrt0055, station_id and peer_id in target:.
  • When a switch rejects a request (it sends the request back behind a second header), the step fails with the reject code and what it means: which field, and the kind of error.