What is the role of a Custom House?

Perhaps, it is an outdated thing, but what is (or was) the purpose of a Custom(s) House?

Usually it’s for storing all manner of junk that needs to be inspected before being allowed into the country, or which has been denied entry and is being sent back to its place of origin.

IOW, a secure warehouse for international junk.

I thought that was a Bonded Warehouse?
Or are they the same?

Yep, they are the same - just a place to store duty-liable goods until the duty is assessed and paid.

Not sure about American usage, but here a custom house is where customs duty is set and paid. A bonded warehouse is where goods are stored pending duty being paid.

As a result, historically a city’s Customs House tended to be built near the city’s harbour in order to be close to the action to collect the customs duty. So there are lots of lovely 19th century examples around the place (Sydney, Melbourne, Brisbane, Auckland).

The same is true here. One of our largest, oldest, and most historic customs houses is in New Orleans.

While the imposing size of this edifice might lead one to assume that it’s a giant warehouse, it was primarily an office for customs inspectors, and doubled as a federal post office and courthouse. (There may have been some warehouse space within it for impounded goods; I’m not sure.)

Customs houses were important in American history as outposts of the federal government in an era when few such outposts existed, and the New Orleans customshouse played a prominent role during the Civil War and Reconstruction. They certainly aren’t “obsolete” today, since the government still collects tariffs, but goods enter the country by a variety of routes today and I suspect that customs employees are more dispersed among ordinary federal office buildings. Much of the New Orleans customshouse is going to be given over to an insectarium whose opening was delayed by Hurricane Katrina.