Where does the expression in the 'black' come from when referring to credit?

The business term "in the red" originated from the early days of accounting when negative numbers were recorded in the books with red ink. To be "in the red" is to be losing money or in debt.

"In the black," to answer your question, means to be making money or a profit, and originates from the same idea.

The first use of the phrases in printed materials was published in 1926 in the book "Wise-Crack Dictionary" by George Maines and Bruce Grant.