For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_getTransactionReceipt - Polygon

Example code for the eth_getTransactionReceipt json-rpc method. Сomplete guide on how to use eth_getTransactionReceipt json-rpc in GetBlock.io Web3 documentation.

The eth_getTransactionReceipt method returns the receipt of a transaction by transaction hash. The receipt contains information about the transaction execution, including status, gas used, and logs.

Parameters

Parameter
Type
Required
Description

transactionHash

string

Yes

32-byte transaction hash

Request

cURL
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionReceipt",
    "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],
    "id": "getblock.io"
}'
JavaScript (Axios)
import axios from 'axios';

const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/';

const payload = {
    jsonrpc: '2.0',
    method: 'eth_getTransactionReceipt',
    params: ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],
    id: 'getblock.io'
};

axios.post(url, payload, {
    headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));

Response

Response (example)
{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "transactionHash": "0x...",
        "blockHash": "0x...",
        "blockNumber": "0x...",
        "status": "0x1",
        "gasUsed": "0x5208",
        "logs": []
    }
}

Response Parameters

Field
Type
Description

jsonrpc

string

JSON-RPC version (2.0)

id

string

Request identifier

result

varies

Transaction receipt object or null if pending

Use Case

The eth_getTransactionReceipt method is useful for:

  • Transaction confirmation

  • Event extraction

  • Gas usage analysis

  • Error detection

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN

-32600

Invalid Request

Malformed request body

-32602

Invalid params

Invalid method parameters

Web3 Integration

Last updated

Was this helpful?