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

# Get invoice with line items

> Get an invoice with its line items attached, including expanded price and billable information.



## OpenAPI

````yaml https://platform.runonatlas.com/external/schema get /external/invoices/{invoiceId}/with-line-items
openapi: 3.0.0
info:
  title: Atlas API
  version: 1.0.0
servers:
  - url: https://platform.runonatlas.com
security: []
paths:
  /external/invoices/{invoiceId}/with-line-items:
    get:
      tags:
        - Invoices
      summary: Get invoice with line items
      description: >-
        Get an invoice with its line items attached, including expanded price
        and billable information.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: The Atlas invoice ID associated with the invoice line item
            example: atlas-internal-invoice-id-123
          required: true
          description: The Atlas invoice ID associated with the invoice line item
          name: invoiceId
          in: path
      responses:
        '200':
          description: The invoice with its line items that have been retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: The Atlas invoice ID
                    example: atlas-internal-invoice-id-123
                  createdAt:
                    type: string
                    format: date
                    description: The date and time the invoice was created
                    example: '2021-01-01T00:00:00.000Z'
                  dueDate:
                    type: string
                    format: date
                    description: The due date of the invoice
                    example: '2021-01-31T00:00:00.000Z'
                  externalId:
                    type: string
                    nullable: true
                    minLength: 1
                    description: >-
                      The external ID of the invoice (e.g. the invoice ID in
                      your payment gateway)
                    example: external-invoice-id-123
                  issueDate:
                    type: string
                    format: date
                    description: The issue date of the invoice
                    example: '2021-01-01T00:00:00.000Z'
                  pendingDate:
                    type: string
                    format: date
                    description: The pending date of the invoice
                    example: '2021-01-01T00:00:00.000Z'
                  status:
                    type: string
                    enum:
                      - test
                      - draft
                      - pending
                      - paused
                      - readyToSync
                      - syncing
                      - readyToCollect
                      - pendingPayment
                      - readyToSend
                      - sending
                      - issued
                      - paymentActionRequired
                      - paymentFailed
                      - paid
                      - void
                      - overdue
                      - deletedFromPaymentGateway
                      - uncollectible
                    description: The status of the invoice
                    example: issued
                  updatedAt:
                    type: string
                    format: date
                    description: The date and time the invoice was last updated
                    example: '2021-01-01T00:00:00.000Z'
                  vanityId:
                    type: number
                    description: The vanity ID of the invoice
                    example: 123456
                  vanityIdString:
                    type: string
                    description: The vanity ID of the invoice as a string
                    example: '123456'
                  customerId:
                    type: string
                    minLength: 1
                    description: The Atlas customer ID
                    example: atlas-internal-customer-id-123
                  merchantId:
                    type: string
                    minLength: 1
                    description: The Atlas merchant ID
                    example: atlas-internal-merchant-id-123
                  subscriptionId:
                    type: string
                    minLength: 1
                    description: The Atlas subscription ID
                    example: atlas-internal-subscription-id-123
                  autoSyncInvoice:
                    type: boolean
                    nullable: true
                    description: >-
                      Whether to automatically sync this invoice to the
                      associated payment gateway
                    example: true
                  autoSendInvoice:
                    type: boolean
                    nullable: true
                    description: >-
                      Whether to automatically send this invoice from the
                      associated payment gateway to the customers email address
                    example: true
                  autoChargeInvoice:
                    type: boolean
                    nullable: true
                    description: >-
                      Whether to automatically charge this invoice to the
                      associated payment gateway
                    example: false
                  paymentGateway:
                    type: string
                    nullable: true
                    enum:
                      - Stripe
                      - QuickBooks
                      - Xero
                    description: The selected payment gateway for this invoice
                    example: Stripe
                  invoiceLineItems:
                    type: array
                    items:
                      type: object
                      properties:
                        amount:
                          type: number
                          description: The amount of the invoice line item
                          example: 100
                        createdAt:
                          type: string
                          format: date
                          description: The date and time the invoice line item was created
                          example: '2021-01-01T00:00:00.000Z'
                        description:
                          type: string
                          minLength: 1
                          description: The description of the invoice line item
                          example: Pro Plan - Monthly
                        details:
                          type: object
                          properties:
                            appliedMaximum:
                              type: number
                            appliedMinimum:
                              type: number
                            quantity:
                              type: number
                            subItems:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  quantity:
                                    type: number
                                  price:
                                    type: number
                                  amount:
                                    type: number
                                required:
                                  - quantity
                                  - price
                                  - amount
                                description: >-
                                  A sub-item within the invoice line item
                                  details
                                example:
                                  name: Additional Feature
                                  quantity: 1
                                  price: 50
                                  amount: 50
                            unitPrice:
                              type: number
                          description: The details of the invoice line item
                          example:
                            quantity: 1
                            unitPrice: 100
                        endDate:
                          type: string
                          format: date
                          description: The end date of the invoice line item
                          example: '2021-01-31T00:00:00.000Z'
                        id:
                          type: string
                          minLength: 1
                          description: The Atlas invoice line item ID
                          example: atlas-internal-invoice-line-item-id-123
                        startDate:
                          type: string
                          format: date
                          description: The start date of the invoice line item
                          example: '2021-01-01T00:00:00.000Z'
                        updatedAt:
                          type: string
                          format: date
                          description: >-
                            The date and time the invoice line item was last
                            updated
                          example: '2021-01-01T00:00:00.000Z'
                        invoiceId:
                          type: string
                          minLength: 1
                          description: >-
                            The Atlas invoice ID associated with the invoice
                            line item
                          example: atlas-internal-invoice-id-123
                        merchantId:
                          type: string
                          minLength: 1
                          description: >-
                            The Atlas merchant ID associated with the invoice
                            line item
                          example: atlas-internal-merchant-id-123
                        priceId:
                          type: string
                          minLength: 1
                          description: >-
                            The Atlas price ID associated with the invoice line
                            item
                          example: atlas-internal-price-id-123
                        price:
                          type: object
                          properties:
                            id:
                              type: string
                              minLength: 1
                              description: The Atlas price ID
                              example: atlas-internal-price-id-123
                            entityType:
                              type: string
                              enum:
                                - entitlement
                                - metric
                              description: The entity type for this price
                              example: entitlement
                            billingMode:
                              type: string
                              enum:
                                - arrears
                                - realTime
                                - advance
                            rules:
                              type: object
                              properties: {}
                              additionalProperties:
                                nullable: true
                              description: The pricing rules for this price
                              example:
                                quantity: 1
                                price: 10
                            priceType:
                              type: string
                              enum:
                                - bulk
                                - matrix
                                - none
                                - package
                                - tier
                                - unit
                            billable:
                              type: object
                              nullable: true
                              properties:
                                id:
                                  type: string
                                  minLength: 1
                                  description: The Atlas billable ID
                                  example: atlas-internal-billable-id-123
                                showOnInvoice:
                                  type: boolean
                                  description: >-
                                    Whether the billable should be shown on the
                                    invoice
                                  example: true
                                hidden:
                                  type: boolean
                                  description: Whether the billable is hidden
                                  example: false
                                singleUnitLabel:
                                  type: string
                                  nullable: true
                                  description: The label for a single unit of the billable
                                  example: Unit
                                multipleUnitLabel:
                                  type: string
                                  nullable: true
                                  description: The label for multiple units of the billable
                                  example: Units
                              required:
                                - id
                                - showOnInvoice
                                - hidden
                                - singleUnitLabel
                                - multipleUnitLabel
                              description: The billable associated with the price
                          required:
                            - id
                            - entityType
                            - billingMode
                            - rules
                            - priceType
                            - billable
                          description: The price associated with the invoice line item
                      required:
                        - amount
                        - createdAt
                        - description
                        - details
                        - endDate
                        - id
                        - startDate
                        - updatedAt
                        - invoiceId
                        - merchantId
                        - priceId
                        - price
                    description: The line items associated with the invoice
                required:
                  - id
                  - createdAt
                  - dueDate
                  - externalId
                  - issueDate
                  - pendingDate
                  - status
                  - updatedAt
                  - vanityId
                  - vanityIdString
                  - customerId
                  - merchantId
                  - subscriptionId
                  - autoSyncInvoice
                  - autoSendInvoice
                  - autoChargeInvoice
                  - paymentGateway
                  - invoiceLineItems
        '400':
          description: >-
            There is an issue with the request data. See the response for more
            details.
        '401':
          description: Invalid API key provided.
        '404':
          description: Invoice not found.
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        You can obtain this key from the Atlas dashboard. It must be of type
        `secret`

````