The transaction hash is a blake2b-256 of the SCALE-encoded extrinsic data.
This should be consistent, no matter which middleware API is used, the process is the same to get to that point. For instance, in the polkadot-js API, each extrinsic will have a
.hash exposed that does exactly this, i.e. it runs a blake2b-256 over the encoded data as received.