> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cairhealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Transaction Output

> Stedi Core-compatible **Retrieve Transaction Output** — the translated JSON document Cair produced (Guide JSON).

An authenticated call returns a `302 Found` whose `Location` header and `documentDownloadUrl` body point at a short-lived, presigned download URL. Follow that URL (with or without the `Authorization` header) to stream the artifact; the presigned URL is valid for 60 minutes and is bound to your organization, the transaction, and the `output` usage.

## Overview

Downloads the transaction's **output document** — the translated JSON (Guide JSON) Cair produced from the input. This is a 1:1 drop-in for Stedi's [Retrieve Transaction Output](https://www.stedi.com/docs/healthcare/api-reference/get-transactions-output) operation and the Stedi SDK's `getTransactionOutput`.

For `835` remits the output is the parsed claim payment JSON; for `837` claims it is the parsed claim JSON. The `Content-Type` of the downloaded artifact is `application/json`.

## Authentication

The **initial** request is authenticated with your JWT Bearer token from [`POST /api/token`](/api-reference/endpoint/token), with the `api-access` feature.

The **download** request that follows the redirect is authenticated by the presigned token in the URL and does **not** require the `Authorization` header.

## Path parameters

<ParamField path="transactionId" type="string" required>
  The `transactionId` whose output artifact you want to download.
</ParamField>

## Two-step download flow

Identical to the input endpoint:

1. **Authenticated request.** Call the endpoint with your Bearer token. Cair responds `302 Found` with a `Location` header and a `{ "documentDownloadUrl": "..." }` body.
2. **Follow the redirect.** Fetch the presigned URL — with or without the `Authorization` header — and Cair streams the JSON output artifact.

The presigned URL is valid for **60 minutes** and is bound to your organization, the transaction, and the `output` usage.

<Note>
  Most SDKs and HTTP clients follow the `302` automatically, so `getTransactionOutput` typically returns the artifact bytes in a single call.
</Note>

## Example

```bash theme={null}
curl -L "https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions/c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6/output" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -o transaction.json
```

```ts theme={null}
const output = await fetch(
  `https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions/${transactionId}/output`,
  { headers: { Authorization: `Bearer ${process.env.CAIR_ACCESS_TOKEN}` } },
);
const json = await output.json();
```

With the Stedi SDK:

```ts theme={null}
const json = await stedi.core.getTransactionOutput('c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6');
```

## Response

`302 Found` — body:

```json theme={null}
{
  "documentDownloadUrl": "https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions/c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6/output?token=0a1b2c3d4e5f60718293a4b5c6d7e8f9"
}
```

`200 OK` (after following the redirect) — the translated JSON artifact:

```json theme={null}
{
  "heading": {
    "payer_identification_N1_loop": {
      "payer_identification_N1": {
        "entity_identifier_code_01": "PR",
        "payer_name_02": "ACME HEALTH PLAN",
        "payer_identifier_04": "12345"
      }
    }
  },
  "detail": {
    "claim_payment_information_CLP": {
      "claim_submitter_identifier_01": "PCN123456",
      "claim_status_code_02": "1",
      "total_claim_charge_amount_03": "250.00",
      "claim_payment_amount_04": "200.00"
    }
  }
}
```

## Errors

| Status | Meaning |
| :- | :- |
| `401` | Missing/invalid Bearer token on the initial call, or an invalid/expired presigned token. |
| `404` | Transaction or output artifact not found, or not owned by your organization. |


## OpenAPI

````yaml GET /api/stedi/2023-08-01/transactions/{transactionId}/output
openapi: 3.1.0
info:
  title: Cair Health APIs
  description: APIs for the Cair Health platform
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://forecaster.cairhealth.com
security:
  - bearerAuth: []
paths:
  /api/stedi/2023-08-01/transactions/{transactionId}/output:
    get:
      summary: Get a transaction's output document
      description: >-
        Stedi Core-compatible **Retrieve Transaction Output** — the translated
        JSON document Cair produced (Guide JSON).


        An authenticated call returns a `302 Found` whose `Location` header and
        `documentDownloadUrl` body point at a short-lived, presigned download
        URL. Follow that URL (with or without the `Authorization` header) to
        stream the artifact; the presigned URL is valid for 60 minutes and is
        bound to your organization, the transaction, and the `output` usage.
      operationId: stediGetTransactionOutput
      parameters:
        - name: transactionId
          in: path
          required: true
          description: >-
            Unique identifier of the processed transaction (the `transactionId`
            returned by the list/poll endpoints).
          schema:
            type: string
      responses:
        '200':
          description: >-
            Raw output artifact bytes, returned when the presigned URL is
            followed. `Content-Type` matches the artifact (typically
            `application/json`).
          content:
            application/json:
              schema:
                type: object
            application/edi-x12:
              schema:
                type: string
                format: binary
            application/octet-stream:
              schema:
                type: string
                format: binary
        '302':
          description: Redirect to the presigned artifact URL.
          headers:
            Location:
              description: Presigned download URL containing the artifact token.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StediArtifactRedirect'
              example:
                documentDownloadUrl: >-
                  https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions/c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6/output?token=0a1b2c3d4e5f60718293a4b5c6d7e8f9
        '401':
          description: Missing/invalid token, or expired token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StediError'
        '404':
          description: >-
            Transaction or artifact not found, or not owned by your
            organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StediError'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StediError'
      security:
        - bearerAuth: []
components:
  schemas:
    StediArtifactRedirect:
      type: object
      description: Body of the `302` redirect returned by the artifact endpoints.
      required:
        - documentDownloadUrl
      properties:
        documentDownloadUrl:
          type: string
          description: >-
            Short-lived (60 minute) presigned URL. Follow it to download the
            artifact bytes.
    StediError:
      type: object
      description: Stedi-compatible error envelope.
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: Stedi error code.
          enum:
            - BadRequestException
            - UnauthorizedException
            - AccessDeniedException
            - ResourceNotFoundException
            - UnprocessableEntityException
            - ServiceException
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.