In ISO message, what\'s the use of STAN and RRN fields? Also, who will generate these values while sending ISO messages?
Another good answer here.
STAN : System Trace Audit Number.
RRN : Retrieval reference number.
RRN is usually wider than the STAN thus giving the RRN more values than the stan before it rolls over and restart the sequencing (asuming the values are defined as numeric).
The usage of these varies from spec to spec. As an example one of the may implementations possible, the stan could be a sequential per transaction number. A transaction I would consider as a request response pair (0100/0110 , 0200/0210, 0220/0230 etc).
The RRN can also be a sequential number but may remain constant across the entire transaction associated with a card. So if you have a 0100/0110 followed by a completion 0220/0230, the rrn would remain the same across these request response pairs. It helps you to link the transactions, so when the 0220 comes in you can look up the original 0100 by using the rrn. A similar thing can be done for reversals too 0200/0210 followed by a 0420/0430).