The serial number for a Ryobi 18.0V battery is located on the bottom of the battery.
For the newer batteries, it is located next to the label SER. NO. on the bottom of the battery.
For the older batteries, they do not have a serial number, just the month and year of manufacturer.