>[The Congress shall have Power . . . ] To regulate Commerce with foreign Nations, and among the several States, and with the Indian Tribes;[0]
(The actual law may not have relied exclusively on the Commerce Clause, you would have to read it to find out. But from a high level there is nothing stopping congress from regulating any instance foreign trade.)
[0] https://constitution.congress.gov/browse/article-1/section-8...