How to confirm the transaction is finality

which API can scan transactions and how to confirm the tx is final and can`t rollback