If you need to fetch the ID of an OU, you can use the CLI to do so; note that you'll need to know the parent of the OU. Here is how you'd get a list of all the OUs and their IDs in a root or OU:
aws organizations list-organizational-units-for-parent \
--parent-id <root-id or parent-ou-id>