---
title: getTransactionReceipt
slug: api/gettransactionreceipt
createdAt: 2022-12-06T18:10:45.000Z
---

{
  "id": "1N3JB8PCDwQFJCfNoK3KR",
  "data": {
    "url": "{{ENVIRONMENT}}",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "{\n\t\"jsonrpc\":\"2.0\",\n\t\"method\":\"eth_getTransactionReceipt\",\n\t\"params\":[\n\t\t\"0xa3ece39ae137617669c6933b7578b94e705e765683f260fcfe30eaa41932610f\"\n\t],\n\t\"id\":1\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "<p>Returns the receipt of a transaction by transaction hash.</p>\n<p><strong>Note:</strong> That the receipt is not available for pending transactions.</p>\n<p><strong>Parameters</strong></p>\n<p><code>DATA</code>, 32 Bytes - hash of a transaction</p>\n<pre><code>params: [\r\n   '0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238'\r\n]\n</code></pre>\n<p><strong>Returns</strong></p>\n<p><code>Object</code> - A transaction receipt object, or <code>null</code> when no receipt was found:</p>\n<p><code>transactionHash</code>: <code>DATA</code>, 32 Bytes - hash of the transaction.</p>\n<p><code>transactionIndex</code>: <code>QUANTITY</code> - integer of the transactions index position in the block.</p>\n<p><code>blockHash</code>: <code>DATA</code>, 32 Bytes - hash of the block where this transaction was in.</p>\n<p><code>blockNumber</code>: <code>QUANTITY</code> - block number where this transaction was in.</p>\n<p><code>cumulativeGasUsed</code>: <code>QUANTITY</code> - The total amount of gas used when this transaction was executed in the block.</p>\n<p><code>gasUsed</code>: <code>QUANTITY</code> - The amount of gas used by this specific transaction alone.</p>\n<p><code>contractAddress</code>: <code>DATA</code>, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise <code>null</code>.</p>\n<p><code>logs</code>: <code>Array</code> - Array of log objects, which this transaction generated.</p>\n<p><code>logsBloom</code>: <code>DATA</code>, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.</p>\n<p>It also returns either :</p>\n<p><code>root</code> : <code>DATA</code> 32 bytes of post-transaction stateroot (pre Byzantium)</p>\n<p><code>status</code>: <code>QUANTITY</code> either <code>1</code> (success) or <code>0</code> (failure)</p>",
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{ENVIRONMENT}} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{ENVIRONMENT}}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{ENVIRONMENT}}\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{ENVIRONMENT}}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": ""
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}