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

# Retrieve an invoice



## OpenAPI

````yaml /openapi/v1.yaml get /invoices/{id}
openapi: 3.1.0
info:
  title: Payoes API
  version: 1.0.0
  description: >
    REST API for creating and managing Stellar payments, customers, checkout
    sessions,

    payment links, and invoices.


    ## Authentication


    Send your API key as a Bearer token. Sandbox keys use the `pk_test_` prefix
    and

    only access sandbox data. Live keys use `pk_live_` and only access
    production data.


    ## Environments


    Sandbox and production are fully isolated. Resources created in one
    environment

    are not visible from API keys scoped to the other.
servers:
  - url: https://payoes.com/api/v1
    description: Production host (replace with your deployment URL)
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Payments
    description: Direct payment intents with hosted Stellar checkout
  - name: Customers
    description: Payer profiles scoped to your organization and environment
  - name: Checkout sessions
    description: Hosted checkout flows with optional redirect URLs
  - name: Payment links
    description: Reusable shareable links that start checkout on each visit
  - name: Invoices
    description: Customer invoices with draft, finalize, and checkout lifecycle
paths:
  /invoices/{id}:
    get:
      tags:
        - Invoices
      summary: Retrieve an invoice
      operationId: getInvoice
      parameters:
        - $ref: '#/components/parameters/InvoiceId'
      responses:
        '200':
          description: Invoice details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoice'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    InvoiceId:
      name: id
      in: path
      required: true
      description: Public invoice ID
      schema:
        type: string
        example: inv_abc123xyz
  schemas:
    Invoice:
      type: object
      required:
        - id
        - object
        - invoice_number
        - status
        - amount
        - created_at
        - updated_at
      properties:
        id:
          type: string
          example: inv_abc123xyz
        object:
          type: string
          enum:
            - invoice
        invoice_number:
          type: string
          example: INV-000001
        status:
          $ref: '#/components/schemas/InvoiceStatus'
        amount:
          type: string
        settlement_asset:
          allOf:
            - $ref: '#/components/schemas/AssetRef'
          nullable: true
          description: From the linked payment after finalize (null on draft)
        allowed_assets:
          type: array
          items:
            $ref: '#/components/schemas/AssetRef'
        description:
          type: string
          nullable: true
        metadata:
          $ref: '#/components/schemas/StringMetadata'
        customer_id:
          type: string
          nullable: true
        checkout_session_id:
          type: string
          nullable: true
        checkout_url:
          type: string
          format: uri
          nullable: true
        hosted_invoice_url:
          type: string
          format: uri
          nullable: true
          description: Public invoice page (`/i/inv_...`)
        items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceItem'
        due_at:
          type: string
          format: date-time
          nullable: true
        paid_at:
          type: string
          format: date-time
          nullable: true
        sent_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    InvoiceStatus:
      type: string
      enum:
        - draft
        - open
        - paid
        - void
    AssetRef:
      type: object
      required:
        - asset_code
      properties:
        asset_code:
          type: string
          description: Stellar asset code (1–12 alphanumeric characters, or XLM)
          example: USDC
        issuer_address:
          type: string
          nullable: true
          description: Issuer public key for credit assets. Null for XLM.
    StringMetadata:
      type: object
      additionalProperties:
        type: string
      nullable: true
    InvoiceItem:
      type: object
      required:
        - description
        - quantity
        - unit_amount
      properties:
        description:
          type: string
        quantity:
          type: string
        unit_amount:
          $ref: '#/components/schemas/StellarAmount'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    StellarAmount:
      type: string
      description: Stellar amount with up to 7 decimal places
      pattern: ^\d+(\.\d{1,7})?$
      example: '10.5'
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Payment not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key from the Payoes dashboard (`pk_test_...` or `pk_live_...`)

````