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

# Obter transação

> Consulte uma transação criada pela AFK e recupere status e hash.

<Note>
  Retorna 404 se a transação não existir para o usuário autenticado.
</Note>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id":"tx_cuid_here",
    "status":"CONFIRMED",
    "hash": "0xec04909efc1a39fb777f649d3c1f556cdc529c824b557e172899bd15077c4c01",
    "explorerUrl": "https://basescan.org/tx/0xec04909efc1a39fb777f649d3c1f556cdc529c824b557e172899bd15077c4c01",
    "chainName":"Base",
    "chainType":"ethereum",
    "chainId":8453,
    "to":"0xrecipient...",
    "value":"1000000000000000",
    "error": null,
    "createdAt":"2025-08-25T08:00:00.000Z",
    "updatedAt":"2025-08-25T08:00:05.000Z"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /tx/{id}
openapi: 3.1.0
info:
  title: AFK Crypto API
  description: >-
    AFK Crypto - Non-custodial wallet automation. Simple REST APIs for EVM and
    Solana.
  version: 1.0.0
servers:
  - url: https://api.afkcrypto.com/v1
    description: Production
security:
  - apiKeyAuth: []
paths:
  /tx/{id}:
    get:
      summary: Get transaction by id
      description: Look up a transaction created by AFK for the authenticated user.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: AFK transaction id.
      responses:
        '200':
          description: Transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          headers:
            x-request-id:
              $ref: '#/components/headers/XRequestId'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            x-request-id:
              $ref: '#/components/headers/XRequestId'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            x-request-id:
              $ref: '#/components/headers/XRequestId'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            x-request-id:
              $ref: '#/components/headers/XRequestId'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            x-request-id:
              $ref: '#/components/headers/XRequestId'
            Retry-After:
              schema:
                type: integer
              description: Seconds until next window
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    Transaction:
      type: object
      properties:
        id:
          type: string
          description: AFK transaction id.
        status:
          type: string
          enum:
            - PENDING
            - SUBMITTED
            - CONFIRMED
            - FAILED
          description: Current transaction status.
        hash:
          type:
            - string
            - 'null'
          description: On-chain transaction hash/signature when available.
        explorerUrl:
          type:
            - string
            - 'null'
          description: >-
            Direct link to the transaction on a chain explorer. Null until a
            hash/signature exists.
        chainType:
          type: string
          enum:
            - ethereum
            - solana
          description: Chain family for the transaction.
        chainId:
          type: integer
          description: >-
            EVM: numeric chainId; Solana: sentinel values 0=mainnet, -2=testnet,
            -3=devnet
        chainName:
          type: string
          description: >-
            Human-readable chain name for display (e.g., Base, Ethereum,
            Solana).
        to:
          type:
            - string
            - 'null'
          description: Destination address, if applicable.
        value:
          type:
            - string
            - 'null'
          description: Native value sent in base units, if applicable.
        error:
          type:
            - string
            - 'null'
          description: Error message if the transaction failed.
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Last updated timestamp.
      required:
        - id
        - status
        - explorerUrl
        - chainType
        - chainId
        - chainName
        - createdAt
        - updatedAt
    ApiError:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: string
          enum:
            - FORBIDDEN
            - UNAUTHORIZED
            - RATE_LIMITED
            - INVALID_INPUT
            - WALLET_NOT_FOUND
            - USER_NOT_LINKED
            - WALLET_NOT_DELEGATED
            - WALLET_ID_REQUIRED
            - CHAIN_UNKNOWN
            - IDEMPOTENT_BODY_MISMATCH
            - IDEMPOTENT_REPLAY
            - PRIVY_RPC_ERROR
            - SEND_FAILED
            - SERVICE_UNAVAILABLE
            - QUOTE_FAILED
            - NOT_FOUND
            - INSUFFICIENT_FUNDS
            - INTERNAL_ERROR
          description: Stable error code for programmatic handling.
        requestId:
          type:
            - string
            - 'null'
          description: Unique request identifier (also in x-request-id header).
      required:
        - error
  headers:
    XRequestId:
      description: Unique request identifier
      schema:
        type: string
  responses:
    ErrorResponse:
      description: Error envelope
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      headers:
        x-request-id:
          $ref: '#/components/headers/XRequestId'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````