> ## Documentation Index
> Fetch the complete documentation index at: https://cantonfoundation-reference-history-contracts.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get transaction by id

<div class="x2mdx-ref-page x2mdx-ref-page--operation x2mdx-ref-page--manual-api" />

<div class="x2mdx-ref-hero">
  <p class="x2mdx-ref-eyebrow">JSON Ledger API</p>

  <h1 class="x2mdx-ref-title">Get transaction by id</h1>

  <div class="x2mdx-ref-badges">
    <span class="x2mdx-ref-badge x2mdx-ref-badge--protocol">OpenAPI</span>

    <span class="x2mdx-ref-badge x2mdx-ref-badge--added">Since 3.4</span>

    <span class="x2mdx-ref-badge x2mdx-ref-badge--changed">Changed 3.5</span>

    <span class="x2mdx-ref-badge x2mdx-ref-badge--removed">Remove as of 3.5.0</span>
  </div>
</div>

Get transaction by id. Provided for backwards compatibility, it will be removed in the Canton version 3.5.0, use v2/updates/update-by-id instead.

## Protocol Details

<dl class="x2mdx-ref-meta-grid">
  <div class="x2mdx-ref-meta-item">
    <dt>Operation ID</dt>
    <dd>postV2UpdatesTransaction-by-id</dd>
  </div>

  <div class="x2mdx-ref-meta-item">
    <dt>Authentication</dt>
    <dd>Bearer token</dd>
  </div>

  <div class="x2mdx-ref-meta-item">
    <dt>Published</dt>
    <dd>3.5</dd>
  </div>
</dl>

## Inputs

### Request body

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ParamField body="updateId" type="string" required>
  The ID of a particular transaction. Must be a valid LedgerString (as described in `value.proto`). Required
</ParamField>

<ParamField body="requestingParties" type="string[]">
  Provided for backwards compatibility, it will be removed in the Canton version 3.5.0. The parties whose events the client expects to see. Events that are not visible for the parties in this collection will not be present in the response. Each element must be a valid PartyIdString (as described in `value.proto`). Optional for backwards compatibility for GetTransactionById request: if defined transaction\_format must be unset (falling back to defaults).
</ParamField>

<ParamField body="transactionFormat" type="object">
  OpenAPI type: `TransactionFormat`.

  A format that specifies what events to include in Daml transactions and what data to compute and include for them.
</ParamField>

## Outputs

### 200

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="transaction" type="JsTransaction" required>
  Filtered view of an on-ledger transaction's create and archive events.
</ResponseField>

### 400

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">text/plain</span>
</div>

<ResponseField name="value" type="string" required>
  *
</ResponseField>

### default

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="code" type="string" required>
  *
</ResponseField>

<ResponseField name="cause" type="string" required>
  *
</ResponseField>

<ResponseField name="correlationId" type="string">
  *
</ResponseField>

<ResponseField name="traceId" type="string">
  *
</ResponseField>

<ResponseField name="context" type="Map_String" required>
  *
</ResponseField>

<ResponseField name="resources" type="Tuple2_String_String[]">
  *
</ResponseField>

<ResponseField name="errorCategory" type="integer (int32)" required>
  *
</ResponseField>

<ResponseField name="grpcCodeValue" type="integer (int32)">
  *
</ResponseField>

<ResponseField name="retryInfo" type="string">
  *
</ResponseField>

<ResponseField name="definiteAnswer" type="boolean">
  *
</ResponseField>

## History

<div class="x2mdx-ref-history" aria-label="Reference history">
  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--remove-as-of">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Remove as of</span>
      <code class="x2mdx-ref-history-event-version">3.5.0</code>
    </div>
  </div>

  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--changed">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Changed</span>
      <code class="x2mdx-ref-history-event-version">3.5</code>
    </div>

    <p class="x2mdx-ref-history-event-detail">The POST /v2/updates/transaction-by-id operation changed in this snapshot.</p>
  </div>

  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--deprecated">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Deprecated</span>
      <code class="x2mdx-ref-history-event-version">3.4</code>
    </div>
  </div>

  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--introduced">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Introduced</span>
      <code class="x2mdx-ref-history-event-version">3.4</code>
    </div>
  </div>
</div>

<RequestExample>
  ```bash Request theme={null}
  curl --request POST \
    --url 'http://localhost:7575/v2/updates/transaction-by-id' \
    --header 'Authorization: Bearer $TOKEN' \
    --header 'Content-Type: application/json' \
    --data '{"updateId":"string","requestingParties":["string"],"transactionFormat":{"eventFormat":{},"transactionShape":"TRANSACTION_SHAPE_UNSPECIFIED"}}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 response theme={null}
  {
    "transaction": {
      "updateId": "string",
      "commandId": "string",
      "workflowId": "string",
      "effectiveAt": "string",
      "events": [
        {}
      ],
      "offset": 0,
      "synchronizerId": "string",
      "traceContext": {},
      "recordTime": "string",
      "externalTransactionHash": "string",
      "paidTrafficCost": 0
    }
  }
  ```

  ```json default response theme={null}
  {
    "code": "string",
    "cause": "string",
    "correlationId": "string",
    "traceId": "string",
    "context": {},
    "resources": [
      [
        "string"
      ]
    ],
    "errorCategory": 0,
    "grpcCodeValue": 0,
    "retryInfo": "string",
    "definiteAnswer": false
  }
  ```
</ResponseExample>
