Introduction

What is ISO8583

ISO8583open in new window is an international standard for financial transaction card originated interchange messaging. It is the International Organization for Standardization standard for systems that exchange electronic transactions initiated by cardholders using payment cards.

ISO8583 Structure

ISO8583 structure is used in Thailand consists of

  • Length of Message (2 Bytes)
  • TPDU header is 60 (1 Byte)
  • Destination Address (2 Bytes)
  • Originator Address (2 Bytes)
  • Message Type (2 Bytes)
  • Bitmap (8 or 16 Bytes)
  • Data (N Bytes)

Request Message

Size (hex)TPDUDestination AddressOriginator AddressMessage TypeBitmapData
2 Bytes1 Byte2 Bytes2 Bytes2 Bytes8 or 16 BytesN Bytes

Response Message

Size (hex)TPDUOriginator AddressDestination AddressMessage TypeBitmapData
2 Bytes1 Byte2 Bytes2 Bytes2 Bytes8 or 16 BytesN Bytes

ISO8583 Example

[Original Message]
0090600120800002003020058020C800040030000000000010000050740022012000375500000000000001D12112012400403360400F 31313131313131313131313131313131313131313131316042353530313330303037393334383337385E535550415649542050414E594146414E475E3232313132303130303030303030303630343030303030300006303030323337
[Extract Message]
[TPDU] 6001208000
        [MSG_TYPE] 0200
        [BITMAP] 3020058020C80004
                [DE003] 003000
                [DE004] 000000001000
                [DE011] 005074
                [DE022] 0022
                [DE024] 0120
                [DE025] 00
                [DE035] 375500000000000001D12112012400403360400F
                [DE041] 3131313131313131
                [DE042] 313131313131313131313131313131
                [DE045] 6042353530313330303037393334383337385E535550415649542050414E594146414E475E323231313230313030303030303030363034303030303030
                [DE062] 0006303030323337
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

ISO8583 Message Type

Message Type is type of transaction for tell to host know type of transaction request with the details to follow

The first and second digits identify the class of message

CodeMeaning
01Authorization message
02Financial transaction message
03File Update/Transfer message
04Reversal message
05Reconciliation control message
06Administrative message
08Network management message

The third and fourth digit identify the message function and transmission mode

CodeMeaning
00Interactive request
10Interactive request response
20Non-Interactive advice
30Non-Interactive advice response
40Notification

01xx - Authorization message

CodeMeaning
0100Authorization request
0110Authorization response
0120Authorization advice
0130Authorization advice response

02xx -Financial transaction message

CodeMeaning
0200Financial transaction request
0210Financial transaction response
0220Financial transaction advice
0230Financial transaction advice response

03xx - File Update/Transfer message

CodeMeaning
0320File Update/Transfer advice
0330File Update/Transfer response

04xx - Reversal message

CodeMeaning
0400Reversal request
0410Reversal response

05xx - Reconciliation message

CodeMeaning
0500Card acceptor reconciliation request
0510Card acceptor reconciliation response

08xx - Network management message

CodeMeaning
0800Network management request
0810Network management response

Bitmap

Bitmap is HEX value to tell data enabled position to can read value at that element position.

How to caluculate bitmap value

  • You must know data elements want to use (DE 1 - 64)
  • If you know data element want to use. You have to fill out a data in format of binary (0, 1) total 64 bits
  • Then convert from Binary to Heximal

Example

Bitmap to want

  • HEX : 3020058020C80004
  • Decimal: 3,4,11,22,24,25,35,41,42,45,62
  1. Initial binary 64 bits.
12345678910111213141516
0000000000000000000000000000000000000000000000000000000000000000
  1. Replace 1 on 0 according substitute the set values of Decimal at position 1 - 64.
12345678910111213141516
0011000000100000000001011000000000100000110010000000000000000100

In the example substitute the set values and get 0011 0000 0010 0000 0000 0101 1000 0000 0010 0000 1100 1000 0000 0000 0000 0100

  1. Convert Binary to Heximal.
12345678910111213141516
3020058020C80004

In the example substitute the set values and get 3020058020C80004

private fun getBitmap(bitmapData: ArrayList<Int>): String? {
        // Create array list of Int type size of 64
        val bitmap = MutableList<Int?>(64) { 0 }
        // Loop bitmapData
        bitmapData.forEach {
                // Add 1 in bitmap element position
                bitmap[it - 1] = 1
        }
        // Join array list to string and change binary to HEX string
        return utils.binaryToHex(bitmap.joinToString(""))
}
1
2
3
4
5
6
7
8
9
10
11
Last Updated:
Contributors: Supavit Panyafang