> For the complete documentation index, see [llms.txt](https://docs.nftrainbow.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nftrainbow.xyz/api-reference/open-api/transaction.md).

# Transaction

## Query Transaction

### Query Transaction Information

The `Query Transaction Information` API provides users to get the transaction information according to id.

{% openapi src="/files/9Xn6Obl1bD1nl4G8Wv3D" path="/v1/tx/{id}" method="get" %}
[swagger.json](https://824600799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Ln5WTo00HxQnwIT1nSu%2Fuploads%2Fgit-blob-b7eb9a491644b192bf198732c032444b2d93114f%2Fswagger.json?alt=media)
{% endopenapi %}

{% tabs %}
{% tab title="Auth" %}

| Name          | Meaning      | Param Type | Data Type |
| ------------- | ------------ | ---------- | --------- |
| Authorization | Bearer Token | Header     | string    |
| {% endtab %}  |              |            |           |

{% tab title="Parameter" %}

<table><thead><tr><th>Name</th><th>Meaning</th><th>Param Type</th><th>Data Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>id</td><td>The id of the transaction</td><td>Path</td><td>string</td><td>true</td></tr></tbody></table>
{% endtab %}

{% tab title="Response" %}

| Name          | Meaning                               | Type    |
| ------------- | ------------------------------------- | ------- |
| hash          | The hash of the transaction           | string  |
| state\_code   | The code of the transaction state     | integer |
| state\_msg    | The msg of the state                  | string  |
| is\_finalized | Whether the transaction is finalized  | boolean |
| is\_success   | Whether the transaction is successful | boolean |
| error\_msg    | The msg of the error during executing | string  |
| {% endtab %}  |                                       |         |

{% tab title="Response Example" %}

```
{
    "hash": "0xd7b1403ff021df36b98bece9eacdb3cab7cc10c5ff76dfb0f885bc08b362658f",
    "state_code": 3,
    "state_msg": "Excuted and success",
    "is_finalized": true,
    "is_success": true,
    "error_msg": ""
}
```

{% endtab %}

{% tab title="Requst Sample" %}

```
curl --request GET \
  --url https://api.nftrainbow.cn/v1/tx/{id} \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nftrainbow.xyz/api-reference/open-api/transaction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
