The Country Specs API returns schemas based on the selling entity and country combination you provide. You can then use these schemas to determine whether an address component or tax identifier is required and also whether it is properly formatted.
Error while loading OpenAPI operation — Can’t find supported Swagger/OpenAPI version in the provided document, version must be a string.