According to the scorecard dictionary, the undergraduate totals are defined as "the number of degree/certificate-seeking undergraduates enrolled in the fall, as reported in the IPEDS Fall Enrollment component.
In the IPEDS raw data (https://nces.ed.gov/ipeds/datacenter/DataFiles.aspx?goToReportId=7), one gets a more finite breakdown of enrollment by year. I have synthesized the total undergrad population by combining the full-time and part-time undergraduate men and women total counts (efrace15/efrace15), but this number does not always seem to match the College Scorecard Data.
I'd love to figure out how my totals can match for replication purposes!