Documentation

Integrated POS

Introduction

Purpose

This document specifies the design for Integrated POS protocol Interface

The audience for this design specification includes

  • Designers
  • Developers
  • Testers

Scope:

This document covers specifications for the modules involved POS and ERP System protocol interface


Definitions and Acronyms:

  • STX 0x02 (Start of Data)

  • ETX 0x03 (End of Data)

  • FS 0x1C (Field Separator)

  • References NA


Data Formats

The specification use the following data element formats:

‘a’ : Alphabetic data elements contain a single character per byte.

The permitted characters are alphabetic only (a to z and A to Z, upper and lower case).

‘an’ : Alphanumeric data elements contain a single character per byte. The permitted characters are alphabetic (a to z and A to Z, upper and lower case) and numeric (0 to 9).

‘ans’ : Alphanumeric Special data elements contain a single character per byte.

‘s’ : Special data elements contain a single character per byte.

‘b’ : These data elements consist of unsigned binary numbers.

‘cn’ : Compressed numeric data elements consist of two numeric digits (having values in the range Hex '0'–'9') per byte. These data elements are left justified and padded with trailing hexadecimal 'F's.

‘n’ : Numeric data elements consist of two numeric digits (having values in the range Hex '0' – '9') per byte. These digits are justified and padded with leading hexadecimal zeroes. Other specifications sometimes refer to this data format as Binary Coded Decimal (“BCD”) or unsigned packed.

‘var’ : Variable data elements are variable length and may contain any bit combination. Additional information on the formats of specific variable data elements is available elsewhere.


Design Overview

System Overview

This solution gives the Integrated POS capability to use POS devices for credit/debit card payment transactions.

Hardware Interfaces

The following are the software and hardware requirements for this solution -

Hardware

  • POS
  • ERP System
  • Serial Port Cable (to connect POS with ERP system)

  • Major Design Constraints and Limitations : None

  • Communication Settings: COM port is used for Serial Communication between POS and ERP system. The default communication settings for Serial Port

Baud rate 9600 bps. It can go upto 1152000 bps - 8 data bits - No parity - 1 stop bit For


Process Flow

The following are the steps involved to get approval for Credit / Debit transactions using this solution.

  1. During idle state, POS device listens in the Serial Port
  2. ERP System checks the availability of POS device by sending CHECKPOS command.
  3. POS device responds positively for CHECKPOS command.
  4. ERP System sends the DOTRAN command with all necessary Data.
  5. POS device validates the received data and Initiate the transaction with bank.
  6. ERP system waits for Response from POS device.
  7. If approved, POS device communicates the details to ERP SYSTEM.

Commands

CHKPOS Packet:

  • Purpose: To check whether POS device is connected to ERP SYSTEM.

  • Request Packet : <STX>CHKPOS.[status] <ETX>

  • Packet Length: Maximum: 10 bytes , Minimum: 10 bytes

Request Packet:

NameFormatLengthDescription
<STX>s1Start of Text
CHKPOSans6Packet Type
‘.’s1
Statusans2‘00’ – default.
<ETX>s1End of Text
  • Response Packet: <STX>CHKPOS.[status]<ETX>

  • Packet Length: Maximum: 10 bytes, Minimum: 10 bytes

NameFormatLengthDescription
<STX>s1Start of Text
CHKPOSans6Packet Type
‘.’s1
Statusans2Status of the transaction. ‘00’ – Success. (Ready for Transaction) ‘01’ – Uninitialized
<ETX>s1End of Text

Response Packet Elements:

  • Request Data Sample: <STX> CHKPOS.00<ETX>

  • Response Data Sample: <STX> CHKPOS.00<ETX>


Request of DOTRAN Packet for Sale and Balance Enquiry

  • Purpose To get transaction details from POS device Packet Length
  • Maximum: xx characters

Request Packet Elements :

NameFormatLengthDescription
<STX>s1Start of Text
DOTRANans6Packet Type
‘.’s1
statusans2Status of the transaction. ‘00’ – Success.
<FS>s1Field Separator
TRAN TYPEN22SALE (00) UPI (19)
<FS>s1Field Separator
LENN22Data Length
<FS>s1Field Separator
DATAAnsDATA
<FS>S1Field Separator
TRANS TIME OUTN22Transaction timeout
<FS>S1Field Separator
SWIPE TIME OUTN22Swipe time out
<FS>S1Field Separator
<ETX>s1End of Text
  • Minimum: xx characters
Sample DataLengthData
Balance Enquiry01D.1
Sale13D.2
  • 0x31 – Saving Account
  • 0x32 – Current Account
  • 0x33 – Credit Account Selected
  • 0x31 – Saving Account
  • 0x32 – Current Account
  • 0x33 – Credit Account Selected

Amount (n12)


Example of the DOTRAN Request Packet: <STX>DOTRAN.00<FS>00<FS>13<FS>data<FS><ETX>

FieldValue
<STX>DOTRAN.02 44 4F 54 52 41 4E 2E
Status30 30
<FS>Tran. Type1C 00
<FS>Data Length1C 00 13
<FS>Account Type1C 31
Amount00 00 00 10 00 00
<FS> Transaction Time1C 01 50
 out – 150 seconds
<FS> Swipe Time out1C 00 50
 50 seconds
 1C0686
<FS> JSON Length 
UDF{“merfno”:”7760”,
 “custName”:”Vijit”,“mobNo”:”123456789”
 “udf1”:”400036666”,“udf2”:”Sale”,
 “udf3”:”CST No-34/3, village chakra, mumbai”,
 “udf4”:”4539”,”udf5”:”47642867”,”udf6”:”ASIX”
 “udf7”:”DC”,”udf8”:”AXISP”,”udf9”:”INT”,
 “udf10”:”6789***990”,”udf11”:”INT”,
 “udf12”:”907891919191”}
Product{"prodName":"Library",
 "prodAmount":1000.00,
 "prodName":"Tuition",
 "prodAmount":2000.00}
<FS><ETX>1C 03

Response DOTRAN Packet for Sale/Balance Inquiry:

If card not swiped successfully and transaction not started due to some reason than terminal send the response packet as below:

NameFormatLengthDescription
<STX>s1Start of Text
DOTRANAns66Packet Type
‘.’s1
StatusAns22Status of the transaction. ‘00’ – if success. ‘01’ – if failed, ‘02’ – Time out to swipe the card, ‘03 ‘--communication failed in start of transaction, ‘04 ‘-- Read Card Error, ‘05’-- Bal inq. Not allowed, ‘06’—communication failed b/w the processing, ‘07’ – Batch Locked, ‘08’ - Uninitialized ‘09’ - Fall Back
ETXs1End of Packet
  • Batch Locked State: Instead of continuing with the SALE transaction system first should send the settlement command as previous settlement request has been failed.

  • Uninitialized State: Terminal must be initialized first as this populate essential parameter for terminal to operate.

  • Fallback state: - When inserted EMV card chip malfunction then terminal moves to fallback state to read data through the magstripe for immediate next transaction.


Example of the response packet: <STX>DOTRAN.02<ETX>

FieldValue
<STX>DOTRAN.02 44 4F 54 52 41 4E 2E
Status30 32
<FS><ETX>1C 03

After completing the transaction, terminal send the data with Transaction Details as:

NameFormatLengthDescription
<STX>s1Start of Text
DOTRANAns66Packet Type
‘.’s1
StatusAns22Status of the transaction. ‘00’ – Success. ‘01’ – Fail
FSS1Field Separator
TRAN TYPEN22SALE (00) BALANCE ENQUIRY (31)
FSS1Field Separator
LENBCD2Data Length
<FS>s1Field Separator
Receipt Hd1Ans2222Receipt Header 1
<FS>s1Field Separator
Receipt Hd2Ans2222Receipt Header 2
<FS>s1Field Separator
Receipt Hd3Ans2222Receipt Header 3
<FS>s1Field Separator
PANN44Last 4 digits of PAN
<FS>s1Field Separator
TRAN AMOUNTN1212Transaction Amount
<FS>s1Field Separator
TimeN66Time HHMMSS
<FS>s1Field Separator
DateN44Date MMYY
<FS>s1Field Separator
RRNAN1212Retrieval Ref. Number
<FS>s1Field Separator
App. CodeAN66Approval Code
<FS>s1Field Separator
Res. CodeAN22Response getting from Host
<FS>s1Field Separator
TIDANS88Terminal Id
<FS>s1Field Separator
MIDANS1515Merchant Id
<FS>s1Field Separator
INV NOANS66Invoice Number
<FS>s1Field Separator
CARD TYPEANS1010Card Type
<FS>s1Field Separator
BATCN NOANS66Batch Number
<FS>s1Field Separator
<ETX>s1End of Text
  • Example of the Response Packet Sent to ERP SYSTEM: <STX>DOTRAN.00<FS>00<FS>Rcpt. Hdr1<FS>Rcpt. Hdr2<FS>Rcpt. Hdr3<FS> Pan<FS>Amount<FS>Time<FS>Date<FS>Exp.Date<FS>RRN<FS>App.Code<F S>Resp.code<FS>TID<FS>MID<FS>Invoice no<FS>Card type<FS>Batch no<FS><ETX>
FieldValue
<STX>DOTRAN.02 44 4F 54 52 41 4E 2E
Status30 30
<FS>Tran. Type1C 00
<FS>Length1C 01 70
 1C 53 48 4F 50 50 45 52 53 42 42 59 49 32 20 20 20 20 20 20 20 20 20
 <FS>Receipt Hdr1 1C 43 48 41 4E 44 49 56 49 4C 49 20 20 20 20 20 20 20 20 20 20 20 20
 <FS>Receipt Hdr2 1C 4D 55 4D 42 41 49 20 20 20 20 20 20 20 4D 48 20 20 20 20 20 20 20
 <FS>Receipt Hdr3
Last 4 digits of PAN1C 21 03
<FS>Amount1C 00 00 00 10 00 00
<FS>Time1C 12 12 00
<FS>Date1C 01 01
<FS>RRN1C 32 30 30 37 32 30 30 37 32 30 30 37
<FS>App Code1C 31 32 32 33 34 35
<FS>Resp. Code1C 30 30
<FS>TID1C 33 30 30 30 30 30 30 34
 1C 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 <FS>MID
<FS>Invoice No1C 30 30 30 30 37 35
<FS>Card Type1C 56 49 53 41 20 20 20 20 20 20
<FS>Batch No.1C 30 30 30 30 38 34
<FS>ETX1C 03

Request of DOTRAN Packet for Settlement

  • Purpose: To settle batch from POS device.
NameFormatLengthDescription
<STX>s1Start of Text
DOTRANans6Packet Type
‘.’s1
statusans2Status of the transaction. ‘00’ – Success. ‘01’ – Fail.
<FS>s1Field Separator
TRAN TYPEN22SETTLEMENT (92)
<FS>s1Field Separator
LENn200
<FS>s1Field Separator
DATAAnsNULL
<FS>S1Field Separator
<ETX>s1End of Text
  • Packet Length : Maximum: xx characters, Minimum: xx characters

Request Packet Elements

  • Example of the DOTRAN Request Packet: <STX>DOTRAN.00<FS>92<FS>00<FS><FS><ETX>

Response of DOTRAN for Settlement

Response packet in case settlement fails in between, either due to communication failure or batch is empty.

NameFormatLengthDescription
<STX>s1Start of Text
DOTRANAns66Packet Type
‘.’s1
StatusAns22Status of the transaction. ‘00’ – Success, ‘01’ – Batch Empty, ‘02’ – Uninitialized, ’03’-- Communication failed in start of transaction,‘04’-- Failed in b/w processing, ’05’-- Settlement Total NULL
ETXs1End of Packet

After completing the transaction, terminal send the data with Transaction Details as:

NameFormatLengthDescription
<STX>s1Start of Text
DOTRANans6Packet Type
‘.’s1
Statusans2Status of the transaction. ‘00’ – Success, ‘01’ – Fail.
FSS1Field Separator
TRAN TYPEN22SETTLEMENT (92)
FSS1Field Separator
LENBCD2Data Length
<FS>s1Field Separator
Receipt Hd1ans22Receipt Header 1
<FS>s1Field Separator
Receipt Hd2ans22Receipt Header 2
<FS>s1Field Separator
Receipt Hd3ans22Receipt Header 3
<FS>s1Field Separator
SALE COUNTN44Number of Sale transaction completed
<FS>S1Field Separator
SALE TOTALN1212Sale Total
<FS>s1Field Separator
VOID COUNTN44Number of Void transaction completed
<FS>S1Field Separator
VOID TOTALN1212VOID Total
<FS>s1Field Separator
TimeN66Time HHMMSS
<FS>s1Field Separator
DateN66Date YYMMDD
<FS>s1Field Separator
RRNAN1212Retrieval Ref. Number
<FS>s1Field Separator
Resp. CodeAN22Response getting from Host
<FS>s1Field Separator
TIDANS88Terminal Id
<FS>s1Field Separator
MIDANS1515Merchant Id
<FS>s1Field Separator
INV NOANS66Invoice Number
<FS>s1Field Separator
CARD TYPEANS1010Card Type
<FS>s1Field Separator
BATCN NOANS66Batch Number
<FS>s1Field Separator
Host NameANS1010Host Name
<FS>S1Field separator
<ETX>s1End of Text

Example of the Response Packet Sent to ERP SYSTEM

<STX>DOTRAN.00<FS>92<FS>Rcpt. Hdr1<FS>Rcpt. Hdr2<FS>Rcpt. Hdr3<FS>SALE COUNT<FS>SALE TOTAL<FS>VOID COUNT<FS>VOID TOTAL<FS>Time<FS>Date<FS> Resp.code<FS>TID<FS>MID<FS>Batch no<FS><ETX>

FieldValue
<STX>DOTRAN.02 44 4F 54 52 41 4E 2E
Status30 30
<FS>Tran. Type1C 92
<FS>Length1C 01 33
 1C 53 48 4F 50 50 45 52 53 42 42 59 49 32 20 20 20 20 20 20 20 20 20
 <FS>Receipt Hdr1 1C 43 48 41 4E 44 49 56 49 4C 49 20 20 20 20 20 20 20 20 20 20 20 20
 <FS>Receipt Hdr2 1C 4D 55 4D 42 41 49 20 20 20 20 20 20 20 4D 48 20 20 20 20 20 20 20
 <FS>Receipt Hdr
<FS>Sale Count1C 00 02
<FS>Sale Total1C 00 00 00 00 20 00
<FS>Void Count1C 00 01
<FS>Void Total1C 00 00 00 00 10 00
<FS>Time1C 12 12 00
<FS>Date1C 01 01 01
<FS>Resp. Code1C 35 30
<FS>TID1C 33 30 30 30 30 30 30 34
 1C 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 <FS>MID
<FS>Batch No.1C 30 30 30 30 38 34
 1C 03

Name Format Length Description

<STX>s1Start of Text
DOTRANans6Packet Type
‘.’s1
statusans2Status of the transaction. ‘00’ – Success.
<FS>s1Field Separator
TRAN TYPEN22VOID (01)
<FS>s1Field Separator
LENBCD200 17
<FS>s1Field Separator
INVOICE NUMANS66Invoice Number
<FS>s1Field Separator
BATCH NoANS66Batch Number
<FS>s1Field Separator
PAN LAST 4 DIGITN44Primary Account Number Last 4 Digit
<FS>S1Field Separator
<ETX>s1End of Text

Request of DOTRAN Packet for Void

  • Purpose: To get transaction details from POS device.
  • Packet Length:
  • Maximum: xx characters
  • Minimum: xx characters

Request Packet Elements:

Example of the DOTRAN Request Packet

<STX>DOTRAN.00<FS>01<FS>00 17<FS>30 30 30 30 37 35<FS>30 30 30 3038 34<FS>21 03<FS><ETX>


Response of DOTRAN Packet for Void

Response packet in case the void transaction failed in between.

NameFormatLengthDescription
<STX>s1Start of Text
DOTRANAns66Packet Type
‘.’s1
StatusAns22Status of the transaction.‘00’ – Success, ‘01’ – Uninitialized, ‘02’ - BATCH Locked, ’03’-- Communication failed in start of transaction, ‘04’-- Failed in b/w processing, ‘05’-- Validation Failed ( ERP SYSTEM), ‘06’-- Transaction record not found, ‘07’ – Already voided
ETXs1End of Packet

Response sent by terminal after completing the void transaction.

NameFormatLengthDescription
<STX>s1Start of Text
DOTRANAns66Packet Type
‘.’s1
StatusAns22Status of the transaction: ‘00’ – Success, ‘01’ – Fail
FSS1Field Separator
TRAN TYPEN22VOID (01)
FSS1Field Separator
LENBCD2Data Length
<FS>s1Field Separator
Receipt Hd1Ans2222Receipt Header 1
<FS>s1Field Separator
Receipt Hd2Ans2222Receipt Header 2
<FS>s1Field Separator
Receipt Hd3Ans2222Receipt Header 3
<FS>s1Field Separator
PAN Last 4 digitN4Last 4 digits of PAN
<FS>s1Field Separator
TRAN AMOUNTN1212Transaction Amount
<FS>s1Field Separator
TimeN66Time HHMMSS
<FS>s1Field Separator
DateN44Date MMYY
<FS>s1Field Separator
RRNAN1212Retrieval Ref. Number
<FS>s1Field Separator
Res. CodeAN22Response getting from Host
<FS>s1Field Separator
TIDANS88Terminal Id
<FS>s1Field Separator
MIDANS1515Merchant Id
<FS>s1Field Separator
INV NOANS66Invoice Number
<FS>s1Field Separator
CARD TYPEANS1010Card Type
<FS>s1Field Separator
BATCN NOANS66Batch Number
<FS>s1Field Separator
<ETX>s1End of Text

Example of the Response Packet Sent to ERP SYSTEM

<STX>DOTRAN.00<FS>01<FS>Rcpt. Hdr1<FS>Rcpt. Hdr2<FS>Rcpt. Hdr3<FS>

Pan<FS>Amount<FS>Time<FS>Date<FS>Exp.Date<FS>RRN<FS> Resp.code

<FS>TID<FS>MID<FS>Invoice no<FS>Card type<FS>Batch no<FS><ETX>

FieldValue
<STX>DOTRAN.02 44 4F 54 52 41 4E 2E
Status30 30
<FS>Tran. Type1C 01
<FS>Length1C 01 63
 1C 53 48 4F 50 50 45 52 53 42 42 59 49 32 20 20 20 20 20 20 20 20 20
 <FS>Receipt Hdr1 1C 43 48 41 4E 44 49 56 49 4C 49 20 20 20 20 20 20 20 20 20 20 20 20
 <FS>Receipt Hdr2 1C 4D 55 4D 42 41 49 20 20 20 20 20 20 20 4D 48 20 20 20 20 20 20 20
 <FS>Receipt Hdr3
<FS> Last 4 digits of PAN1C 21 03
<FS>Amount1C 00 00 00 10 00 00
<FS>Time1C 12 12 00
<FS>Date1C 01 01
<FS>Expiry Date1C 10 08
<FS>RRN1C 32 30 30 37 32 30 30 37 32 30 30 37
<FS>Resp. Code1C 30 30
<FS>TID1C 33 30 30 30 30 30 30 34
<FS>MID1C 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35
<FS>Invoice No1C 30 30 30 30 37 35
<FS>Card Type1C 56 49 53 41 20 20 20 20 20 20
<FS>Batch No.1C 30 30 30 30 38 34
<FS>ETX1C 03