The first flush toilet was invented in the year 1596 for Queen Elizabeth by inventor Sir John Harrington which was Queen Elizabeth's Godson.
However the patent for the flush toilet didn't happen until the year 1775 when the patent for the flush toilet was issued to inventor Alexander Cummings.
Although the flush toilet was invented during 1596 and 1775 the flush toilet didn't go into widespread use until around 1851 and before that they were mostly a luxury that only the rich people could afford.