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

# Get an invoice

> Fetches a single invoice by its inv_* ID.



## OpenAPI

````yaml /api-reference/openapi.json get /api/gateway/invoices/{invoiceId}
openapi: 3.1.0
info:
  title: Open Rails API
  version: 0.1.0
  description: >-
    Hosted checkout, provider routing, runtime schemas, and normalized webhook
    examples for Open Rails merchants and agents.
servers:
  - url: https://dash.getopenrails.com
    description: Production dashboard and API origin
security: []
tags:
  - name: Gateway
  - name: Agent
  - name: Routing
  - name: Webhooks
paths:
  /api/gateway/invoices/{invoiceId}:
    get:
      tags:
        - Gateway
      summary: Get an invoice
      description: Fetches a single invoice by its inv_* ID.
      operationId: getGatewayInvoice
      parameters:
        - name: invoiceId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Invoice record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoice'
        '404':
          description: Invoice not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
components:
  schemas:
    Invoice:
      type: object
      required:
        - id
        - object
        - status
        - amount
        - currency
        - created
      properties:
        id:
          type: string
          description: Invoice ID with inv_* prefix.
        object:
          type: string
          enum:
            - invoice
        customerId:
          type: string
        paymentId:
          type: string
        sessionId:
          type: string
        amount:
          type: number
        currency:
          type: string
        status:
          type: string
          enum:
            - open
            - paid
            - void
        metadata:
          $ref: '#/components/schemas/Metadata'
        created:
          type: string
          format: date-time
    ApiErrorResponse:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          type: boolean
          enum:
            - false
        error:
          $ref: '#/components/schemas/ActionError'
    Metadata:
      type: object
      additionalProperties:
        type: string
        maxLength: 500
      default: {}
    ActionError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
        suggestion:
          type: string
        issues:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              code:
                type: string
              message:
                type: string

````