> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_getTransactionReceipt | Optimism

> Optimism API method eth_getTransactionReceipt retrieves the receipt of a transaction by its hash. Use it on Optimism via Chainstack.

Optimism API method `eth_getTransactionReceipt` retrieves the receipt of a transaction by its hash. This receipt includes details such as the transaction's outcome (status), gas used, and logs generated by the transaction. This method is crucial for confirming transaction execution and for interacting with smart contracts.

## Parameters

* `transactionHash` — the hash of the transaction for which the receipt is being requested.

## Response

* `Transaction receipt` — the receipt object with:
  * `blockHash` — the block hash. Identifies the block in which the transaction was included. This field is `null` for transactions that have not yet been included in a block.
  * `blockNumber` — the number of the block in which the transaction was included. This field is `null` for transactions that have not yet been included in a block.
  * `contractAddress` — the contract address created by the transaction if it was a contract creation transaction. Otherwise, the value is `null`.
  * `cumulativeGasUsed` — the total amount of gas used in the block until this transaction was executed.
  * `effectiveGasPrice` — the actual value deducted from the sender's account for this transaction.
  * `from` — the address of the sender who initiated the transaction.
  * `gasUsed` — the amount of gas used by this specific transaction alone.
  * `logs` — an array of log objects this transaction generates, if any. Logs are generated by smart contracts.
  * `logsBloom` — the bloom filter used by light clients to quickly retrieve logs related to the transaction.
  * `status` — the success status of the transaction, represented as `1` for success or `0` for failure.
  * `to` — the recipient's address of the transaction if it was a transaction to an address. For contract creation transactions, this field is `null`.
  * `transactionHash` — the hash that uniquely identifies the transaction.
  * `transactionIndex` — the index of the transaction within the block.
  * `type` — the [type](https://ethereum.org/en/developers/docs/transactions/#types-of-transactions) of the transaction. `0` indicates a regular transfer; `2` indicates a contract creation or smart contract function call.
  * `l1Fee` — this field represents the cost incurred for executing the transaction on the Ethereum mainnet (Layer 1). It is calculated by multiplying the `l1GasPrice` by the `l1GasUsed`.
  * `l1FeeScalar` — a scaling factor applied to the actual gas consumption on the Ethereum mainnet (Layer 1). This value is used to determine the dynamic costs associated with the transaction. Setting to 1 does not alter the Layer 1 gas usage.
  * `l1GasPrice` — the price of gas, measured in Wwei, that the transaction is willing to pay for execution on the Ethereum mainnet (Layer 1).
  * `l1GasUsed` — the total amount of gas units the transaction consumes during its execution on the Ethereum mainnet (Layer 1).

The `l1Fee`, `l1FeeScalar`, `l1GasPrice`, and `l1GasUsed` fields are specific to Optimism, an Optimistic Rollup solution for scaling Ethereum. These fields provide information about the transaction's interaction with the Layer 1 (Ethereum mainnet) chain, which is necessary for the security and validity of the Optimistic Rollup.

## Use case

The `eth_getTransactionReceipt` method is essential for:

* DApps that need to confirm the outcome of a transaction, especially after interacting with smart contracts.
* Services that monitor transactions for confirmation, gas usage, and event logging.
* Tools that analyze the efficiency and effects of transactions on the Optimism network.


## OpenAPI

````yaml openapi/optimism_node_api/eth_getTransactionReceipt.json POST /efb0a5eccd2caa5135eb54eba6f7f300
openapi: 3.0.0
info:
  title: eth_getTransactionReceipt example
  version: 1.0.0
  description: >-
    This is an API example for eth_getTransactionReceipt, a method to get the
    receipt of a transaction by its  hash.
servers:
  - url: https://optimism-mainnet.core.chainstack.com
security: []
paths:
  /efb0a5eccd2caa5135eb54eba6f7f300:
    post:
      tags:
        - Ethereum Operations
      summary: eth_getTransactionReceipt
      operationId: getTransactionReceipt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - id
                - params
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getTransactionReceipt
                id:
                  type: integer
                  default: 1
                params:
                  type: array
                  default:
                    - >-
                      0xd0a7bd7d80ba09a5a627b00fe6d05cde7d45939de9b16cb96d9029da1757b59b
                  items:
                    type: string
      responses:
        '200':
          description: Transaction receipt for the given transaction hash
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object
                    properties:
                      transactionHash:
                        type: string
                      transactionIndex:
                        type: string
                      blockHash:
                        type: string
                      blockNumber:
                        type: string
                      from:
                        type: string
                      to:
                        type: string
                      cumulativeGasUsed:
                        type: string
                      gasUsed:
                        type: string
                      contractAddress:
                        type: string
                      logs:
                        type: array
                        items:
                          type: object
                          properties:
                            removed:
                              type: boolean
                            logIndex:
                              type: string
                            transactionIndex:
                              type: string
                            transactionHash:
                              type: string
                            blockHash:
                              type: string
                            blockNumber:
                              type: string
                            address:
                              type: string
                            data:
                              type: string
                            topics:
                              type: array
                              items:
                                type: string
                      logsBloom:
                        type: string
                      status:
                        type: string

````