# zks_getTransactionDetails

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://zksync-mainnet.g.alchemy.com/v2/{apiKey}

Retrieves details for a given transaction.

Reference: https://www.alchemy.com/docs/chains/zksync/zk-sync-api-endpoints/zks-get-transaction-details

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Transaction hash | string | Yes | The hash of the transaction. |

## Result

**Transaction details** (object): Detailed information about the specified transaction.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "zks_getTransactionDetails",
  "params": [
    "0x22de7debaa98758afdaee89f447ff43bab5da3de6acca7528b281cc2f1be2ee9"
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "isL1Originated": true,
    "status": "verified",
    "fee": "0x0",
    "gasPerPubdata": "0x320",
    "initiatorAddress": "0x87869cb87c4fa78ca278df358e890ff73b42a39e",
    "receivedAt": "2023-03-03T23:52:24.169Z",
    "ethCommitTxHash": "0x3da5b6eda357189c9243c41c5a33b1b2ed0169be172705d74681a25217702772",
    "ethProveTxHash": "0x2f482d3ea163f5be0c2aca7819d0beb80415be1a310e845a2d726fbc4ac54c80",
    "ethExecuteTxHash": "0xdaff5fd7ff91333b161de54534b4bb6a78e5325329959a0863bf0aae2b0fdcc6"
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://zksync-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "zks_getTransactionDetails",
  "params": [
    "0x22de7debaa98758afdaee89f447ff43bab5da3de6acca7528b281cc2f1be2ee9"
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'zks_getTransactionDetails',
    params: ['0x22de7debaa98758afdaee89f447ff43bab5da3de6acca7528b281cc2f1be2ee9']
  })
};

fetch('https://zksync-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://zksync-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "zks_getTransactionDetails",
    "params": ["0x22de7debaa98758afdaee89f447ff43bab5da3de6acca7528b281cc2f1be2ee9"]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://zksync-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"zks_getTransactionDetails\",\n  \"params\": [\n    \"0x22de7debaa98758afdaee89f447ff43bab5da3de6acca7528b281cc2f1be2ee9\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://zksync-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"zks_getTransactionDetails\",\n  \"params\": [\n    \"0x22de7debaa98758afdaee89f447ff43bab5da3de6acca7528b281cc2f1be2ee9\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://zksync-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"zks_getTransactionDetails\",\n  \"params\": [\n    \"0x22de7debaa98758afdaee89f447ff43bab5da3de6acca7528b281cc2f1be2ee9\"\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: zks_getTransactionDetails
summary: Retrieves details for a given transaction.
description: Retrieves details for a given transaction.
params:
  - name: Transaction hash
    required: true
    description: The hash of the transaction.
    schema:
      title: 32 byte hex value
      type: string
      pattern: ^0x[0-9a-f]{64}$
result:
  name: Transaction details
  description: Detailed information about the specified transaction.
  schema:
    type: object
    title: Transaction Details
    required:
      - isL1Originated
      - status
      - fee
      - gasPerPubdata
      - initiatorAddress
      - receivedAt
      - ethCommitTxHash
      - ethProveTxHash
      - ethExecuteTxHash
    properties:
      isL1Originated:
        type: boolean
        description: Indicates whether the transaction originated on Layer 1.
      status:
        type: string
        description: Current status of the transaction (e.g., verified).
      fee:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Transaction fee.
      gasPerPubdata:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Gas amount per unit of public data for this transaction.
      initiatorAddress:
        title: hex encoded address
        type: string
        pattern: ^0x[0-9a-fA-F]{40}$
        description: Address of the transaction initiator.
      receivedAt:
        type: string
        description: Timestamp when the transaction was received.
      ethCommitTxHash:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Transaction hash of the commit operation.
      ethProveTxHash:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Transaction hash of the proof submission.
      ethExecuteTxHash:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Transaction hash of the execution.
examples:
  - name: zks_getTransactionDetails example
    params:
      - name: Transaction hash
        value: '0x22de7debaa98758afdaee89f447ff43bab5da3de6acca7528b281cc2f1be2ee9'
    result:
      name: Transaction details
      value:
        isL1Originated: true
        status: verified
        fee: '0x0'
        gasPerPubdata: '0x320'
        initiatorAddress: '0x87869cb87c4fa78ca278df358e890ff73b42a39e'
        receivedAt: '2023-03-03T23:52:24.169Z'
        ethCommitTxHash: '0x3da5b6eda357189c9243c41c5a33b1b2ed0169be172705d74681a25217702772'
        ethProveTxHash: '0x2f482d3ea163f5be0c2aca7819d0beb80415be1a310e845a2d726fbc4ac54c80'
        ethExecuteTxHash: '0xdaff5fd7ff91333b161de54534b4bb6a78e5325329959a0863bf0aae2b0fdcc6'
```
