Q:

What was the treaty that ended the war between the USA and Mexico

Answer

The Treaty of Guadalupe Hidalgo [1848] was the treaty between the United States and Mexico that ended the Mexican War.