Trying to identify part name and correct bolt size
I disassembled two that were readily available, one on a Giant and one on a Specialized. Both use an M8 x 18mm. The 18mm  length dimension did not include the head of the bolt. The total length was 24mm. I also noted both bolt heads were slightly shorter than industrial standard. Visually it looks like a bolt with a taller head would work but  1/2 head would  be exposed. Most small components of sub-assemblies aren't readily available the entire part would need replacement.  Although sometimes a local sop might have something in a stray parts bin. In your case since you only lack a bolt, any local supplier should be able to supply something that will work.