> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Get Receipt \[transaction.getReceipt]

Returns the transaction receipt for a given transaction hash.

## Usage

This example returns the transaction receipt for a given transaction hash.

:::code-group
```ts twoslash [example.ts]
import { client } from './viem.config'

const receipt = await client.transaction.getReceipt({
  hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
})
// @log: {
// @log:   blockHash: '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d',
// @log:   blockNumber: 19868020n,
// @log:   contractAddress: null,
// @log:   cumulativeGasUsed: 4658883n,
// @log:   effectiveGasPrice: 5326406548n,
// @log:   from: '0xa152f8bb749c55e9943a3a0a3111d18ee2b3f94e',
// @log:   gasUsed: 21000n,
// @log:   logs: [],
// @log:   status: 'success',
// @log:   to: '0x15d4c048f83bd7e37d49ea4c83a07267ec4203da',
// @log:   transactionHash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
// @log:   transactionIndex: 0,
// @log:   type: 'eip1559',
// @log:   ...
// @log: }
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, http, publicActions } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
}).extend(publicActions())
```
:::

### Standalone Action

Call `Actions.transaction.getReceipt` directly by passing the Client as the first argument.

:::code-group
```ts twoslash [example.ts]
import { Actions } from 'viem'
import { client } from './viem.config'

const receipt = await Actions.transaction.getReceipt(client, {
  hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
})
// @log: {
// @log:   blockHash: '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d',
// @log:   blockNumber: 19868020n,
// @log:   contractAddress: null,
// @log:   cumulativeGasUsed: 4658883n,
// @log:   effectiveGasPrice: 5326406548n,
// @log:   from: '0xa152f8bb749c55e9943a3a0a3111d18ee2b3f94e',
// @log:   gasUsed: 21000n,
// @log:   logs: [],
// @log:   status: 'success',
// @log:   to: '0x15d4c048f83bd7e37d49ea4c83a07267ec4203da',
// @log:   transactionHash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
// @log:   transactionIndex: 0,
// @log:   type: 'eip1559',
// @log:   ...
// @log: }
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, http } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
})
```
:::

## Return Value

`TransactionReceipt`

The transaction receipt. When the connected Client's [`chain`](/docs/chains) defines a `codecs.transactionReceipt` codec, the return type reflects that chain's custom receipt shape.

## Parameters

### hash

* **Type:** `Hex`

Get a transaction receipt by the transaction's hash.

```ts twoslash
import { Actions, Client, http } from 'viem'
import { mainnet } from 'viem/chains'

const client = Client.create({ chain: mainnet, transport: http() })
// ---cut---
const receipt = await Actions.transaction.getReceipt(client, {
  hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', // [!code focus]
})
```

## Errors

| Error | Description |
| --- | --- |
| `Actions.transaction.Errors.TransactionReceiptNotFoundError` | The transaction receipt could not be found. |
