Why was credit invented?

Credit was invented in order to allow people to get the value of some service/good immediately while providing a legal means to pay for that item/service over time.

In the US, Singer was the first to provide installment credit for the purchase of sewing machines.