Skip to content
dogtopus edited this page Apr 23, 2023 · 20 revisions

iclogo Suica electronic money service

IC (Intelligent Card) is a network of interoperable pre-paid transit cards used across Japan, promoted by Japan Railways Group (JR) companies and other local operators. Complete interoperability started on 2013-03-23.

This is also known as Cybernet Standard (サイバネ規格).

All cards use Sony FeliCa media.

Note: There are also other Japanese cards which cannot be used in the IC network, and are not supported by Metrodroid.

Metrodroid and many other projects refer to all of these as "Suica", but there are multiple, functionally equivalent cards:

Name Serial
Prefix
Issuer
Hayakaken (はやかけん) FC Fukuoka City Transportation Bureau
ICOCA (イコカ) JW JR West (Kansai region)
icsca (イクスカ) SK Sendai City Transportation Bureau
Kitaca (キタカ) JH JR Hokkaidō
manaca (マナカ) TP non-JR operators in Nagoya
nimoca (ニモカ) NR Nishi-Nippon Railroad (Fukuoka)
PASMO (パスモ) PB non-JR operators in Tokyo
SUGOCA (スゴカ) JK JR Kyūshū
Suica (スイカ) JE JR East (Tokyo and eastern Japan)
TOICA (トイカ) JC JR Central

PiTaPa (ピタパ) (Surutto Kansai Conference) is part of the IC network, but does not have an electronic money function. Instead, it is a post-pay card where all transactions are deducted from a linked bank account at the end of each month.

Note: With the exception of Hayakaken (はやかけん), all card names use their English name when in Japanese text, and the name of the card is printed only in English.

Note: The katakana in rōmaji is ka, but this is an abbreviation of the English word "card".

Planned IC related work in Metrodroid

Past, finished work

  • Remove unused functionality in nfc-felica-lib
  • Merge nfc-felica-lib into Metrodroid's core
  • Document nfc-felica-lib in English (partially done, but stopped)
  • Rewrite nfc-felica-lib with protocol model similar to other cards (FelicaProtocol)
  • Document new FelicaProtocol

Resources

This page was translated from Japanese. The original version is at http://sourceforge.jp/projects/felicalib/wiki/suica

The following information is based on information from Dennosuke, and guisa's package (page3.nifty.com/slokar/pasori/gsuica).

System 0x3

In general, Suica/ICOCA/PiTaPa/PASMO/TOICA are the same format. Suica contains two service codes: entrance/exit records and history. The following explanation refers only to the history. The service code is 0x090f (In IruCa the system code changes to 0xde80, but the format is basically the same as those of Suica.)

Service 0x090f (History)

Each 16 byte block consists of:

First Last Length Field description Pre-conditions
0 0 1 Terminal type (see below)
1 1 1 Processing type (see below)
2 2 1 unknown, WDIC says: settlement type
3 3 1 unknown, WDIC says: entrance/exit type
4 5 2 Transaction date (7 bit year, 4 bit month, 5 bit day); January = 1
6 7 2 not used terminal type 0x02
6 7 2 Bus line code terminal type 0x05
6 7 2 Transaction time (5 bit hour, 6 bit minute) terminal type 0xc7 or 0xc8
6 7 2 Entry rail line code (1 byte) and station code (1 byte) otherwise
8 9 2 not used terminal type 0x02, 0x03, 0x07, 0x08, 0x12 - 0x15, 0xc7 or 0xc8
8 9 2 Bus stop code terminal type 0x05
8 9 2 Exit rail line code (1 byte) and station code (1 byte) otherwise
10 11 2 Balance in JPY (little endian)
12 12 1 unknown
13 14 2 Transaction sequence
15 15 1 Region code (for railway stations)

Only the balance is little endian, so please be cautious.

In the case of sales of goods or buses, the format changes in the following ways.

  • Sale of Goods: The 6th to 7th bytes are the time. The first 5 bits are the hour the next 6 are the minute, the last 5 are unclear (there are not enough bits for it to be the seconds?)
    • When the processing values are 70, 73, 74, 75, 198, 203, it represents a sale of goods.
  • Bus: The Entered LineCode and Entered Station Order are removed, and the Exited LineCode and Exited Station Orer become 16 bits (the 6th-7th and 8th-9th bytes, respectively)
    • When the processing values are 13, 15, 31, 35, it represents a bus.

The terminal type values are as follows:

Code Terminal Type
0x03 Fare adjustment machine
0x04 Portable
0x05 Vehicle (bus)
0x07 Ticket machine
0x08 Ticket machine
0x09 Quick refill machine (SMART ICOCA? nimoca point exchange machine?)
0x12 Tokyo Monorail ticket machine (or automatic ticket vending machines?)
0x13 Ticket machine, etc
0x14 Ticket machine, etc (maybe station ticket counter?)
0x15 Ticket machine, etc (maybe commuter pass vending machine)
0x16 Turnstile (automatic ticket gate?)
0x17 Ticket validator (simple ticket gate?)
0x18 Ticket booth
0x19 Ticket office (Green Window)
0x1a Ticket gate terminal ??
0x1b Mobile phone (PaSoRi?)
0x1c Connection adjustment machine
0x1d Transfer adjustment machine
0x1f Simple deposit machine
0x20 (window terminal / meitetsu?)
0x21 (checkout machine?)
0x22 (window processing machines? simple ticket gates? busses?)
0x23 (shinkansen ticket gate?)
0x24 (in-car supplement ticket issuing machine?)
0x46 VIEW ALTTE (ATM)
0x48 VIEW ALTTE (ATM)
0xc7 Point of sales (also taxis?)
0xc8 Vending machine

Processing values are as follows

  • 1: Fare Payment (Exit from Ticket Gate)
  • 2: Charge
  • 3: Purchase Ticket (Purchase magnetic ticket)
  • 4: Payment
  • 5: Payment (Admission Payment)
  • 6: Booth Exit (Process at stationmaster booth)
  • 7: New (Issue New)
  • 8: Deduction (Booth deduction)
  • 13: Bus (PiTaPa type)
  • 15: Bus (IruCa type)
  • 17: Re-issue (Re-issue process)
  • 19: Payment (Shinkansen Use)
  • 20: Entry A (Autocharge upon entrance)
  • 21: Exit A (Autocharge upon exit)
  • 31: Deposit (Bus Charge)
  • 35: Purchase Ticket (Purchase special bus/streetcar ticket)
  • 70: Sale of Goods
  • 72: Bonus (Bonus Charge)
  • 73: Deposit (Register Deposit)
  • 74: Cancel Sale of Goods
  • 75: Admission and Goods (Sale of admission and goods)
  • 198: Goods and Cash (Purchase goods with part cash)
  • 203: Admission Goods and Cash (Purchase admission and goods with part cash)
  • 132: Payment (Third party payment)
  • 133: Payment (Third party admission payment)

Service 0x108f (Taps log)

Typically 3 blocks (entries).

Each 16 byte block consists of:

First Last Length Field description
0 0 1 bit 0x80 high = tap on, low = tap off, other bits unknown
1 1 1 unknown (zero)
2 3 2 Rail line code
4 4 1 only for JR East 0x20=tap off, 0x10=tap on
5 5 1 unknown
6 7 2 Transaction date (same as in service 0x090f)
8 8 1 Transaction hour (binary-coded decimal)
9 9 1 Transaction minute (binary-coded decimal)
10 11 2 Fare in JPY (little endian)

Station Code/Store Code

Can be looked up through cybernation station code database at: http://www.denno.net/SFCardFan/ (Archived)

Station Names

When terminal type is other than 0xc7, 0xc8, 0x05. Station name can be looked up via AreaCode, LineCode and StationCode. In this case, the folowing AreaCode is needed for the following LineCodes:

  • over 0x7f : 0 (JR Line)
  • over 0x80 and region is 0: 1 (Kanto (East Japan) public/private railway)
  • over 0x80 and region is 1: 2 (Kansai (West Japan) public/private railway)

Store Name

When terminal type is 0xc7, 0xc8.

Stores can be searched via the 4 bytes of AreaCode, TerminalCode, LineCode, StationCode. The AreaCodes are: 1: Suica/PASMO, 2: ICOCA, 4:IruCa. However, because the AreaCode is not recorded in the history, and a code is shared between Suica/PASMO, it is impossible to determine the store name with 100% accuracy.

Vehicle Terminal (Bus)

When terminal type is 0x05.

Here, the IruCa bus stop code table should be looked at, using LineCodes and station order as a key.

Clone this wiki locally