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

# get invoice

> Fetch an invoice header along with its line items projected from the ledger. Amounts are at pgledger scale 8 ($1 = 100_000_000). Provider calls convert to currency minor units at the provider boundary.



## OpenAPI

````yaml /openapi.json get /v1/invoices/get/{invoiceId}
openapi: 3.0.3
info:
  title: Unprice API
  version: 1.0.0
servers:
  - url: https://api.unprice.dev
    description: Production
  - url: http://localhost:8787
    description: Development
  - url: https://preview-api.unprice.dev
    description: Preview
security:
  - bearerAuth: []
paths:
  /v1/invoices/get/{invoiceId}:
    get:
      tags:
        - invoices
      summary: get invoice
      description: >-
        Fetch an invoice header along with its line items projected from the
        ledger. Amounts are at pgledger scale 8 ($1 = 100_000_000). Provider
        calls convert to currency minor units at the provider boundary.
      operationId: invoices.get
      parameters:
        - schema:
            type: string
            description: The invoice ID
            example: inv_1H7KQFLr7RepUyQBKdnvY
          required: true
          name: invoiceId
          in: path
      responses:
        '200':
          description: Invoice header + projection lines
          content:
            application/json:
              schema:
                type: object
                properties:
                  invoice:
                    type: object
                    properties:
                      id:
                        type: string
                      project_id:
                        type: string
                      subscription_id:
                        type: string
                      customer_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - unpaid
                          - paid
                          - waiting
                          - void
                          - draft
                          - failed
                      currency:
                        type: string
                        enum:
                          - USD
                          - EUR
                      statement_key:
                        type: string
                      statement_start_at:
                        type: integer
                      statement_end_at:
                        type: integer
                      due_at:
                        type: integer
                      past_due_at:
                        type: integer
                      issue_date:
                        type: integer
                        nullable: true
                      sent_at:
                        type: integer
                        nullable: true
                      paid_at:
                        type: integer
                        nullable: true
                      gross_amount:
                        type: integer
                        minimum: 0
                      amount_due:
                        type: integer
                        minimum: 0
                      amount_paid:
                        type: integer
                        minimum: 0
                      amount_included:
                        type: integer
                        minimum: 0
                    required:
                      - id
                      - project_id
                      - subscription_id
                      - customer_id
                      - status
                      - currency
                      - statement_key
                      - statement_start_at
                      - statement_end_at
                      - due_at
                      - past_due_at
                      - issue_date
                      - sent_at
                      - paid_at
                      - gross_amount
                      - amount_due
                      - amount_paid
                      - amount_included
                  lines:
                    type: array
                    items:
                      type: object
                      properties:
                        entry_id:
                          type: string
                        statement_key:
                          type: string
                        kind:
                          type: string
                        description:
                          type: string
                          nullable: true
                        quantity:
                          type: number
                          nullable: true
                        amount:
                          type: integer
                          minimum: 0
                        amount_due:
                          type: integer
                          minimum: 0
                        amount_paid:
                          type: integer
                          minimum: 0
                        amount_included:
                          type: integer
                          minimum: 0
                        collectable:
                          type: boolean
                        settlement_source:
                          type: string
                          enum:
                            - provider
                            - credit_line
                            - cash_wallet
                            - plan_included
                            - trial
                            - promo
                            - manual
                        settlement_status:
                          type: string
                          enum:
                            - due
                            - paid
                            - included
                        wallet_credit_id:
                          type: string
                          nullable: true
                        wallet_credit_source:
                          type: string
                          nullable: true
                          enum:
                            - promo
                            - plan_included
                            - trial
                            - manual
                            - credit_line
                        wallet_id:
                          type: string
                          nullable: true
                        currency:
                          type: string
                          enum:
                            - USD
                            - EUR
                        created_at:
                          type: string
                          format: date-time
                      required:
                        - entry_id
                        - statement_key
                        - kind
                        - description
                        - quantity
                        - amount
                        - amount_due
                        - amount_paid
                        - amount_included
                        - collectable
                        - settlement_source
                        - settlement_status
                        - wallet_credit_id
                        - wallet_credit_source
                        - wallet_id
                        - currency
                        - created_at
                required:
                  - invoice
                  - lines
        '400':
          description: >-
            The server cannot or will not process the request due to something
            that is perceived to be a client error (e.g., malformed request
            syntax, invalid request message framing, or deceptive request
            routing).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBadRequest'
        '401':
          description: >-
            Although the HTTP standard specifies "unauthorized", semantically
            this response means "unauthenticated". That is, the client must
            authenticate itself to get the requested response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrUnauthorized'
        '403':
          description: >-
            The client does not have access rights to the content; that is, it
            is unauthorized, so the server is refusing to give the requested
            resource. Unlike 401 Unauthorized, the client's identity is known to
            the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrForbidden'
        '404':
          description: >-
            The server cannot find the requested resource. In the browser, this
            means the URL is not recognized. In an API, this can also mean that
            the endpoint is valid but the resource itself does not exist.
            Servers may also send this response instead of 403 Forbidden to hide
            the existence of a resource from an unauthorized client. This
            response code is probably the most well known due to its frequent
            occurrence on the web.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrNotFound'
        '409':
          description: >-
            This response is sent when a request conflicts with the current
            state of the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrConflict'
        '412':
          description: >-
            The requested operation cannot be completed because certain
            conditions were not met. This typically occurs when a required
            resource state or version check fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrPreconditionFailed'
        '429':
          description: >-
            The user has sent too many requests in a given amount of time ("rate
            limiting")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrTooManyRequests'
        '500':
          description: >-
            The server has encountered a situation it does not know how to
            handle.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrInternalServerError'
components:
  schemas:
    ErrBadRequest:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - BAD_REQUEST
              description: A machine readable error code.
              example: BAD_REQUEST
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/BAD_REQUEST
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrUnauthorized:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
              description: A machine readable error code.
              example: UNAUTHORIZED
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/UNAUTHORIZED
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrForbidden:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - FORBIDDEN
              description: A machine readable error code.
              example: FORBIDDEN
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/FORBIDDEN
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrNotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - NOT_FOUND
              description: A machine readable error code.
              example: NOT_FOUND
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/NOT_FOUND
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrConflict:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - CONFLICT
              description: A machine readable error code.
              example: CONFLICT
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/CONFLICT
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrPreconditionFailed:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - PRECONDITION_FAILED
              description: A machine readable error code.
              example: PRECONDITION_FAILED
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/PRECONDITION_FAILED
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrTooManyRequests:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - TOO_MANY_REQUESTS
              description: A machine readable error code.
              example: TOO_MANY_REQUESTS
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/TOO_MANY_REQUESTS
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrInternalServerError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - INTERNAL_SERVER_ERROR
              description: A machine readable error code.
              example: INTERNAL_SERVER_ERROR
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/INTERNAL_SERVER_ERROR
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
  securitySchemes:
    bearerAuth:
      bearerFormat: root key
      type: http
      scheme: bearer
      x-speakeasy-example: UNPRICE_API_KEY

````