---
title: "Get transaction by hash"
method: GET
path: "/transactions/by_hash/{txn_hash}"
tags: ["Transactions"]
---

# Get transaction by hash

`GET /transactions/by_hash/{txn_hash}`

Look up a transaction by its hash. This is the same hash that is returned
by the API when submitting a transaction (see PendingTransaction).

When given a transaction hash, the server first looks for the transaction
in storage (on-chain, committed). If no on-chain transaction is found, it
looks the transaction up by hash in the mempool (pending, not yet committed).

To create a transaction hash by yourself, do the following:
1. Hash message bytes: "RawTransaction" bytes + BCS bytes of [Transaction](https://aptos-labs.github.io/aptos-core/aptos_types/transaction/enum.Transaction.html).
2. Apply hash algorithm `SHA3-256` to the hash message bytes.
3. Hex-encode the hash bytes with `0x` prefix.

## Path parameters

- `txn_hash` string, required

## Response `200`

- Transaction — unresolved $ref

## Other responses

- `400`
- `403`
- `404`
- `410`
- `500`
- `503`

## Changes

- **2025-10-10** `ede18bdaa4e0` — 8 info
  - added the required property `oneOf[#/components/schemas/Transaction_BlockEpilogueTransaction]/allOf[#/components/schemas/BlockEpilogueTransaction]/changes/items/oneOf[#/components/schemas/WriteSetChange_WriteModule]/allOf[#/components/schemas/WriteModule]/data/abi/structs/items/is_enum` to the response with the `200` status
  - added the required property `oneOf[#/components/schemas/Transaction_BlockMetadataTransaction]/allOf[#/components/schemas/BlockMetadataTransaction]/changes/items/oneOf[#/components/schemas/WriteSetChange_WriteModule]/allOf[#/components/schemas/WriteModule]/data/abi/structs/items/is_enum` to the response with the `200` status
  - added the required property `oneOf[#/components/schemas/Transaction_GenesisTransaction]/allOf[#/components/schemas/GenesisTransaction]/changes/items/oneOf[#/components/schemas/WriteSetChange_WriteModule]/allOf[#/components/schemas/WriteModule]/data/abi/structs/items/is_enum` to the response with the `200` status
  - added the required property `oneOf[#/components/schemas/Transaction_GenesisTransaction]/allOf[#/components/schemas/GenesisTransaction]/payload/oneOf[#/components/schemas/GenesisPayload_WriteSetPayload]/allOf[#/components/schemas/WriteSetPayload]/write_set/oneOf[#/components/schemas/WriteSet_DirectWriteSet]/allOf[#/components/schemas/DirectWriteSet]/changes/items/oneOf[#/components/schemas/WriteSetChange_WriteModule]/allOf[#/components/schemas/WriteModule]/data/abi/structs/items/is_enum` to the response with the `200` status
  - …4 more
- …earlier changes not shown

[Full history](https://skmtc.dev/aptoslabs/apis/aptos-node-api/changes/transactions/by_hash/:txn_hash/get.md)

---

[API](https://skmtc.dev/aptoslabs/apis/aptos-node-api.md) · [All operations](https://skmtc.dev/aptoslabs/apis/aptos-node-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/aptoslabs/aptos-node-api/revisions/ede18bdaa4e0/schema)
