---
updatedAt: 2026-09-08T09:54:11.000Z
agentTools:
  projectIndex: https://cn.developers.tron.network/llms.txt
---

# GetTransactionInfoById

按交易 ID 查询交易执行收据——SolidityNode 版本，仅返回已固化交易的 receipt。

> 📘 **与 GetTransactionById 的区别**
>
> 本接口返回交易**执行后的收据**（receipt）——手续费、能量消耗、合约执行状态、事件日志、内部交易等；[GetTransactionById](https://cn.developers.tron.network/reference/gettransactionbyid) 返回的是**交易本体**（请求方提交的 `raw_data` + 签名）。两者配合才能拿到一笔交易的完整状态。

***

## 确认语义

响应是交易执行后的 receipt。SolidityNode 返回该 receipt 时，包含该交易的区块已经固化。对普通 TRX 转账，交易本体中的 `TransferContract` 已包含转账金额和收款地址；本接口主要用于确认交易是否已经进入固化状态。对智能合约交易，必须读取 receipt 才能判断实际执行结果。

## 使用建议

使用本接口确认智能合约交易的最终执行状态。`receipt.result` 为 `SUCCESS` 时，才表示合约执行成功；如果查询不到 receipt，不要立即判定失败，应结合交易过期窗口和已固化区块扫描结果继续确认。

充值检测、TRC-20 Event 解析和内部交易解析的完整流程，参见[基于区块扫描的充值监听机制](doc:exchangewallet-integrate-with-the-tron-network#5-基于区块扫描的充值监听机制)。

***

## 相关资源

* [GetTransactionInfoById (FullNode)](https://cn.developers.tron.network/reference/gettransactioninfobyid) —— FullNode 版本
* [GetTransactionById](https://cn.developers.tron.network/reference/gettransactionbyid) —— 查询交易本体
* [API 签名与广播流程](https://cn.developers.tron.network/docs/api-signature-and-broadcast-flow) —— 构建、广播和固化确认的完整路径
* [确认语义](https://cn.developers.tron.network/docs/confirmation-semantics) —— 区分交易本体、执行 receipt 和已固化 receipt
* [基于区块扫描的充值监听机制](doc:exchangewallet-integrate-with-the-tron-network#5-基于区块扫描的充值监听机制) —— 充值检测、TRC-20 Event 和内部交易解析流程
* [合约调用与能量计费](https://cn.developers.tron.network/docs/set-feelimit) —— receipt 中 energy\_usage / energy\_fee 等字段的来源

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "全节点 HTTP API",
    "version": "4.8.0"
  },
  "servers": [
    {
      "url": "https://api.shasta.trongrid.io",
      "description": "Shasta 测试网"
    },
    {
      "url": "https://nile.trongrid.io",
      "description": "Nile 测试网"
    },
    {
      "url": "https://api.trongrid.io",
      "description": "TRON 主网（真实资产）"
    }
  ],
  "components": {
    "responses": {
      "NodeHttpError": {
        "description": "节点或上游服务返回的非 2xx 错误。具体状态码取决于参数校验、节点状态和网关策略。",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "Error": {
                  "type": "string",
                  "description": "java-tron 返回的错误信息。"
                },
                "code": {
                  "type": "string",
                  "description": "节点或网关提供的可选错误码。"
                },
                "message": {
                  "type": "string",
                  "description": "节点或网关提供的可选错误信息。"
                }
              },
              "additionalProperties": true
            }
          }
        }
      }
    },
    "schemas": {
      "NodeHttpBusinessError": {
        "title": "错误信息",
        "type": "object",
        "description": "请求处理发生异常时，java-tron 可能随 HTTP 200 返回此格式；具体错误信息位于 `Error` 字段。",
        "required": [
          "Error"
        ],
        "properties": {
          "Error": {
            "type": "string",
            "description": "java-tron 返回的错误信息。"
          }
        },
        "examples": [
          {
            "Error": "Invalid request parameters."
          }
        ],
        "additionalProperties": false
      }
    }
  },
  "security": [
    {}
  ],
  "paths": {
    "/walletsolidity/gettransactioninfobyid": {
      "post": {
        "summary": "GetTransactionInfoById",
        "description": "根据交易 ID 查询交易手续费和区块高度。（已固化状态）",
        "operationId": "gettransactioninfobyid-1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "description": "交易 ID（哈希）。示例：`bd32eef7469d57011a092c59c745cab1e49c501e9f0ac15c580656f9ead1e319`",
                    "default": ""
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "请求正常完成时，响应体为接口返回结果；请求处理发生异常时，HTTP 状态仍可能为 200，此时仅返回包含 `Error` 字段的错误信息。",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\": \"d0807adb3c5412aa150787b944c96ee898c997debdc27e2f6a643c771edb5933\",\n  \"fee\": 2790,\n  \"blockNumber\": 5467102,\n  \"blockTimeStamp\": 1546455621000,\n  \"contractResult\": [\n    \"\"\n  ],\n  \"receipt\": {\n    \"net_fee\": 2790\n  }\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "返回结果",
                      "not": {
                        "type": "object",
                        "required": [
                          "Error"
                        ]
                      },
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "d0807adb3c5412aa150787b944c96ee898c997debdc27e2f6a643c771edb5933"
                        },
                        "fee": {
                          "type": "integer",
                          "example": 2790,
                          "default": 0
                        },
                        "blockNumber": {
                          "type": "integer",
                          "example": 5467102,
                          "default": 0
                        },
                        "blockTimeStamp": {
                          "type": "integer",
                          "example": 1546455621000,
                          "default": 0
                        },
                        "contractResult": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": ""
                          }
                        },
                        "receipt": {
                          "type": "object",
                          "properties": {
                            "net_fee": {
                              "type": "integer",
                              "example": 2790,
                              "default": 0
                            }
                          }
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/NodeHttpBusinessError"
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/NodeHttpError"
          }
        },
        "deprecated": false,
        "security": []
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```