API to close a transaction manually