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

# Get Transaction

> Retrieve full details for a single transaction by ID. GET /transactions/{id}. Requires transactions:read scope.

## Overview

Returns the full details of a single card transaction, including merchant data, billing amounts, and related transaction references (e.g. the original authorization that a reversal or refund relates to).

## Path Parameters

| Parameter | Type   | Description                        |
| --------- | ------ | ---------------------------------- |
| `id`      | string | The transaction ID (prefix `txn_`) |

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.fyatu.com/api/v3.20/transactions/txn_01HXYZ8888ABCDEF9999 \
    -H "Authorization: Bearer $FYATU_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const resp = await fetch(
    'https://api.fyatu.com/api/v3.20/transactions/txn_01HXYZ8888ABCDEF9999',
    { headers: { 'Authorization': `Bearer ${process.env.FYATU_API_KEY}` } }
  );
  const { data: tx } = await resp.json();
  console.log(tx.type, tx.status);
  console.log('Merchant:', tx.merchant?.name);
  console.log('Amount:', tx.amount.displayValue);
  ```

  ```python Python theme={null}
  import os, requests

  resp = requests.get(
      'https://api.fyatu.com/api/v3.20/transactions/txn_01HXYZ8888ABCDEF9999',
      headers={'Authorization': f'Bearer {os.environ["FYATU_API_KEY"]}'}
  )
  tx = resp.json()['data']
  print(tx['type'], tx['status'])
  print('Merchant:', tx.get('merchant', {}).get('name'))
  print('Amount:', tx['amount']['displayValue'])
  ```
</CodeGroup>

## Success Response (200)

```json theme={null}
{
  "success": true,
  "status": 200,
  "message": "Transaction retrieved",
  "data": {
    "transactionId":        "txn_01HXYZ8888ABCDEF9999",
    "type":                 "CLEARING",
    "status":               "CLEARED",
    "amount": {
      "value":        2999,
      "currency":     "USD",
      "displayValue": "29.99"
    },
    "merchant": {
      "name":           "Amazon",
      "city":           "Seattle",
      "country":        "US",
      "mcc":            "5999",
      "mccDescription": "Miscellaneous General Merchandise"
    },
    "cardId":               "crd_01HXYZ5555ABCDEF1111",
    "cardholderId":         "chl_01HXYZ1234ABCDEF5678",
    "programId":            "prg_01HXYZ9876ABCDEF0000",
    "relatedTransactionId": "txn_01HXYZ8888ABCDEF0000",
    "environment":          "LIVE",
    "declineReason":        null,
    "processedAt":          "2026-05-22T16:00:00Z",
    "createdAt":            "2026-05-22T14:30:00Z"
  },
  "meta": {
    "requestId":  "req_01HXY123456ABCDEF",
    "platform": "Fyatu CaaS",
    "timestamp":  "2026-05-22T16:05:00Z"
  }
}
```

## Field Reference

| Field                  | Description                                                                               |
| ---------------------- | ----------------------------------------------------------------------------------------- |
| `transactionId`        | Unique transaction identifier                                                             |
| `type`                 | `AUTHORIZATION`, `CLEARING`, `REVERSAL`, `REFUND`, `DECLINE`, or `FEE`                    |
| `status`               | `PENDING`, `CLEARED`, `REVERSED`, or `DECLINED`                                           |
| `amount.value`         | Amount in cents                                                                           |
| `amount.currency`      | ISO 4217 currency code                                                                    |
| `amount.displayValue`  | Human-readable amount (e.g. `29.99`)                                                      |
| `merchant`             | Merchant details — present for purchases and declines; absent for fees/reversals          |
| `merchant.mcc`         | ISO 18245 Merchant Category Code                                                          |
| `relatedTransactionId` | For reversals/refunds, the ID of the original transaction; `null` otherwise               |
| `declineReason`        | Present on `DECLINE` transactions — reason the transaction was declined; `null` otherwise |
| `processedAt`          | When the transaction was settled/processed; `null` if still pending                       |

## Error Codes

| Code                    | HTTP | Cause                                                                 |
| ----------------------- | ---- | --------------------------------------------------------------------- |
| `TRANSACTION_NOT_FOUND` | 404  | Transaction does not exist or belongs to another business/environment |
| `INSUFFICIENT_SCOPE`    | 403  | Key lacks `transactions:read` scope                                   |


## OpenAPI

````yaml v3.20/openapi.json GET /transactions/{id}
openapi: 3.1.0
info:
  title: FYATU CaaS API v3.20
  description: >-
    FYATU Cards-as-a-Service API â€” API key authentication, Cardholder
    lifecycle, Card issuance, Transactions, Webhooks, and Programs.
  version: 3.20.0
  contact:
    name: FYATU Support
    url: https://fyatu.com
    email: support@fyatu.com
servers:
  - url: https://api.fyatu.com/api/v3.20
    description: >-
      FYATU CaaS API â€” the environment (LIVE or SANDBOX) is determined by the
      API key, not the URL
security:
  - BearerAuth: []
tags:
  - name: Meta
    description: Liveness, account info, and supported event types
  - name: Account
    description: Account-level balance and funding status
  - name: Programs
    description: Read card program configuration
  - name: Cardholders
    description: Create and manage cardholder profiles
  - name: Cards
    description: Issue, fund, freeze, and terminate virtual cards
  - name: Transactions
    description: Read-only card transaction history
  - name: Webhooks
    description: Manage webhook endpoints for real-time event delivery
  - name: Products
    description: Read card product configurations
paths:
  /transactions/{id}:
    get:
      tags:
        - Account
      summary: Get a transaction
      description: Retrieve full details for a single program-balance transaction.
      operationId: getTransaction
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: txn_01HXYZ8888ABCDEF9999
      responses:
        '200':
          description: Transaction retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponse'
              example:
                success: true
                status: 200
                message: Transaction retrieved
                data:
                  transactionId: txn_01HXYZ8888ABCDEF9999
                  type: CARD_FUNDING
                  direction: DEBIT
                  status: SETTLED
                  amount: 500
                  currency: USD
                  fee: 0
                  reference: fund_01HXYZ5555ABCDEF1111
                  account: prg_01HXYZ9876ABCDEF0000
                  memo: Card funding â€” crd_01HXYZ5555ABCDEF1111
                  balanceBefore: 10000
                  balanceAfter: 9500
                  relatedTransactionId: null
                  completedAt: '2026-05-22T14:32:00Z'
                  createdAt: '2026-05-22T14:30:00Z'
                  cardId: crd_01HXYZ5555ABCDEF1111
                meta:
                  requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
                  platform: Fyatu CaaS
                  timestamp: '2026-05-22T15:00:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    TransactionResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        status:
          type: integer
          example: 200
        message:
          type: string
          example: Transaction retrieved
        data:
          $ref: '#/components/schemas/Transaction'
        meta:
          $ref: '#/components/schemas/Meta'
    Transaction:
      type: object
      properties:
        transactionId:
          type: string
          example: txn_01HXYZ8888ABCDEF9999
        type:
          type: string
          enum:
            - AUTHORIZATION
            - CLEARING
            - REVERSAL
            - FEE
          example: AUTHORIZATION
        status:
          type: string
          enum:
            - APPROVED
            - DECLINED
            - REVERSED
          example: PENDING
        amount:
          $ref: '#/components/schemas/TransactionAmount'
        merchant:
          $ref: '#/components/schemas/TransactionMerchant'
        cardId:
          type: string
          example: crd_01HXYZ5555ABCDEF1111
        cardholderId:
          type: string
          example: chl_01HXYZ1234ABCDEF5678
        programId:
          type: string
          example: prg_01HXYZ9876ABCDEF0000
        relatedTransactionId:
          type: string
          nullable: true
          description: Set for reversals and refunds
          example: null
        environment:
          type: string
          enum:
            - LIVE
            - SANDBOX
          example: LIVE
        declineReason:
          type: string
          nullable: true
          example: null
        processedAt:
          type: string
          format: date-time
          nullable: true
          example: null
        createdAt:
          type: string
          format: date-time
          example: '2026-05-22T14:30:00Z'
    Meta:
      type: object
      properties:
        requestId:
          type: string
          example: req_a1b2c3d4e5f6a7b8c9d0e1f2
        platform:
          type: string
          example: Fyatu CaaS
        timestamp:
          type: string
          format: date-time
          example: '2026-05-22T15:00:00Z'
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        status:
          type: integer
          example: 422
        message:
          type: string
          example: Human readable message
        error:
          $ref: '#/components/schemas/ErrorBody'
        meta:
          $ref: '#/components/schemas/Meta'
    TransactionAmount:
      type: object
      properties:
        value:
          type: integer
          format: int64
          description: Amount in cents
          example: 2999
        currency:
          type: string
          example: USD
        displayValue:
          type: string
          description: Human-readable amount without currency symbol
          example: '29.99'
    TransactionMerchant:
      type: object
      properties:
        name:
          type: string
          nullable: true
          example: Amazon
        city:
          type: string
          nullable: true
          example: Seattle
        country:
          type: string
          nullable: true
          example: US
        mcc:
          type: string
          nullable: true
          description: ISO 18245 Merchant Category Code
          example: '5999'
        mccDescription:
          type: string
          nullable: true
          example: Miscellaneous General Merchandise
    ErrorBody:
      type: object
      properties:
        code:
          type: string
          example: VALIDATION_ERROR
        detail:
          type: string
          example: dateOfBirth must be in YYYY-MM-DD format
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: API key missing
              value:
                success: false
                status: 401
                message: API key is required
                error:
                  code: AUTH_TOKEN_MISSING
                  detail: API key is required
                meta:
                  requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
                  platform: Fyatu CaaS
                  timestamp: '2026-05-22T15:00:00Z'
            invalid:
              summary: API key invalid
              value:
                success: false
                status: 401
                message: Invalid API key
                error:
                  code: AUTH_TOKEN_INVALID
                  detail: Invalid API key
                meta:
                  requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
                  platform: Fyatu CaaS
                  timestamp: '2026-05-22T15:00:00Z'
    Forbidden:
      description: Scope denied or business suspended
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            status: 403
            message: Scope denied
            error:
              code: INSUFFICIENT_SCOPE
              detail: This endpoint requires the cards:write scope
            meta:
              requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
              platform: Fyatu CaaS
              timestamp: '2026-05-22T15:00:00Z'
    NotFound:
      description: Resource not found or does not belong to your business
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimitExceeded:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            status: 429
            message: Rate limit exceeded
            error:
              code: RATE_LIMIT_EXCEEDED
              detail: Too many requests
            meta:
              requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
              platform: Fyatu CaaS
              timestamp: '2026-05-22T15:00:00Z'
    InternalError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            status: 500
            message: Internal error
            error:
              code: INTERNAL_ERROR
              detail: An unexpected error occurred
            meta:
              requestId: req_a1b2c3d4e5f6a7b8c9d0e1f2
              platform: Fyatu CaaS
              timestamp: '2026-05-22T15:00:00Z'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from the FYATU CaaS portal. Pass as `Authorization: Bearer
        <key>`.

````