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

# Get invoice URL for a payment

> Returns a URL to the order's invoice PDF. Polar generates invoices lazily: if one does not exist yet this triggers generation and responds 202, and the client should retry shortly.



## OpenAPI

````yaml https://api.crosmos.dev/openapi.json get /api/v1/billing/payments/{payment_id}/invoice
openapi: 3.1.0
info:
  title: Crosmos API
  version: 0.1.0
servers:
  - url: /
security: []
paths:
  /api/v1/billing/payments/{payment_id}/invoice:
    get:
      tags:
        - billing
      summary: Get invoice URL for a payment
      description: >-
        Returns a URL to the order's invoice PDF. Polar generates invoices
        lazily: if one does not exist yet this triggers generation and responds
        202, and the client should retry shortly.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: payment_id
          in: path
      responses:
        '200':
          description: Invoice URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceResponse'
        '202':
          description: Invoice is being generated; retry shortly
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoicePending'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Insufficient role
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No such payment for this org
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingError'
        '502':
          description: Provider error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingError'
      security:
        - bearerAuth: []
components:
  schemas:
    InvoiceResponse:
      type: object
      properties:
        invoice_url:
          type: string
          format: uri
      required:
        - invoice_url
    InvoicePending:
      type: object
      properties:
        status:
          type: string
          enum:
            - generating
      required:
        - status
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
        code:
          type: string
        request_id:
          type: string
        fields:
          nullable: true
      required:
        - detail
    BillingError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT access token or API key (csk_...)

````