What are the steps to open and close a short using endpoints?

The question is simple but the process is not yet, I would like to know what endpoints to use and in what order to open a short operation, only know is that the quoted asset is first borrowed, then the base asset is frozen , then to close the quoted asset is buyed again and then is pay the loan, it is easy to hear, but among the operations of lending, freezing, buying and paying there are intrinsic operations such as checking the balance or obtaining the interest generated by the loan before of paying and one more than another that I can’t think of