The 8-digit number is printed on the inside of the left headphone cap. The cap is removed by turning it counter-clockwise.
Alternatively, the serial number can be found in the Bang & Olufsen app under "Product settings -> About" after adding your Beoplay H9i.