Amex track data format

noflowcontrol picture noflowcontrol · Apr 14, 2014 · Viewed 12.6k times · Source

I am having troubles with track data processing:

It would appear that various Amex cards labelled as ‘ANSI’ cards within various Amex test cases do not contain a service code. There is no indication that the service code is not contained in the track data (This includes no separators etc). How would you determine that no service code is contained in the track and avoid incorrectly using the discretionary data as the service code instead?

Example:

Standard Track: 374245455400001=131210112011234500000 – Service code is 101

Track with no service code: 374245455400001=1412120112345 - So in this case 120 is incorrectly interpreted as the service code whereas it forms part of the Discretionary data.

Thanks.

Answer

user2284063 picture user2284063 · Mar 11, 2015

I have this specification for the two types of Amex cards:-
ANSI
Field Name Length
Start Sentinel 1
Account Number (PAN) 15
Field Separator 1 ‘=’
Expiration Date (YYMM) 4
Effective Date (YYMM) 4
Discretionary Data 5
End Sentinel 1
LRC 1
Total: 32
ISO
Field Name Length
Start Sentinel 1
Account Number (PAN) 15
Field Separator 1 ‘=’
Expiration Date (YYMM) 4
Service Code 3
Effective Date (YYMM) 4
Discretionary Data 8
Language Code 2
End Sentinel 1
LRC 1
Total: 40

So I check for the length of Track 2, if it is less than 40 then I do not bother to check for the Service Code.