If you are not on your Mac, you can get it through the iTunes connect website.
- Login to App Store Connect (https://appstoreconnect.apple.com/)
- Get output (JSON) from (https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/user/detail)
- You can now get your iTunes Connect ids from the
associatedAccountsarray with the differentcontentProviderobjects – the entry namedcontentProviderIdreflects the iTunes Connect id, lookup for thenamevalue to pick the correct one
Source: https://github.com/fastlane/fastlane/issues/4301#issuecomment-253461017