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

# Get an invoice by id

> This handler get the invoice details based on the invoice ID



## OpenAPI

````yaml /api/specs/billing-api.json get /billing/v1/invoices/{invoiceId}
openapi: 3.0.0
info:
  title: Lynkwell API
  version: 1.376.0
  description: API Documentation for billing service
servers:
  - url: https://api.lynkwell.com
security: []
tags: []
paths:
  /billing/v1/invoices/{invoiceId}:
    get:
      tags:
        - Invoices
      summary: Get an invoice by id
      description: This handler get the invoice details based on the invoice ID
      parameters:
        - in: path
          name: invoiceId
          required: true
          description: invoiceId for which the details are supposed to be extracted
          schema:
            type: string
      responses:
        '200':
          description: Invoice Details based on the invoice ID
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Invoice'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingBadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingUnauthorizedError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingForbiddenError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingNotFoundError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingInternalServerError'
      security:
        - oauth2:
            - read:invoice
components:
  schemas:
    Invoice:
      type: object
      properties:
        id:
          type: string
        paymentProfileId:
          type: string
        network:
          type: string
        pdfUrl:
          description: Will be null if a pdf url can not be generated.
          nullable: true
          type: string
        status:
          type: string
          enum:
            - DRAFT
            - OPEN
            - PAID
            - VOID
            - UNCOLLECTIBLE
            - UNKNOWN
        totalPaymentAttempts:
          type: number
        subTotal:
          type: number
        taxTotal:
          type: number
        currency:
          type: string
        invoiceItems:
          description: >-
            An array of references to invoice items that are included in this
            invoice.
          type: array
          items:
            type: string
        subscriptionItems:
          description: An array of subscription item objects
          type: array
          items:
            type: object
            required:
              - id
              - network
              - total
              - currency
              - paymentProfileId
              - priceId
              - subscriptionId
              - description
              - createdAt
              - updatedAt
            properties:
              id:
                type: string
              network:
                type: string
              total:
                type: number
              currency:
                type: string
              paymentProfileId:
                type: string
              priceId:
                type: string
              invoiceId:
                type: string
              subscriptionId:
                type: string
              description:
                type: string
              createdAt:
                type: string
                format: date-format
              updatedAt:
                type: string
                format: date-format
        lastPaymentAttemptDate:
          type: string
          format: date-time
        periodStart:
          type: string
          format: date-time
        periodEnd:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - paymentProfileId
        - network
        - pdfUrl
        - status
        - totalPaymentAttempts
        - subtotal
        - taxTotal
        - total
        - currency
        - invoiceItems
        - periodStart
        - periodEnd
        - createdAt
    BillingBadRequestError:
      type: object
      description: The response body for a 400 request
      properties:
        type:
          type: string
          enum:
            - BAD_REQUEST
        code:
          type: string
          enum:
            - INVALID_REQUEST_PARAMETERS
            - REFERENCE_ERROR
            - NETWORK_NOT_ENROLLED
            - CARD_ERROR
            - ALREADY_HAVE_SUBSCRIPTION
        message:
          type: string
    BillingUnauthorizedError:
      type: object
      description: The response body for a 401 request
      properties:
        message:
          type: string
    BillingForbiddenError:
      type: object
      description: The response body for a 403 request
      properties:
        type:
          type: string
          enum:
            - FORBIDDEN
        code:
          type: string
          enum:
            - UNAUTHORIZED
            - ASSET_NOT_CONNECTED
        message:
          type: string
    BillingNotFoundError:
      type: object
      description: The response body for a 404 request
      properties:
        type:
          type: string
          enum:
            - NOT_FOUND
        code:
          type: string
          enum:
            - PAYMENT_PROFILE_NOT_FOUND
            - INVOICE_NOT_FOUND
        message:
          type: string
    BillingInternalServerError:
      type: object
      description: The response body for a 500 request
      properties:
        type:
          type: string
          enum:
            - INTERNAL_ERROR
        code:
          type: string
          enum:
            - INTERNAL_SERVER_ERROR
        message:
          type: string
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth2 Client Credentials Flow
      flows:
        clientCredentials:
          tokenUrl: https://lynkwell-prod.us.auth0.com/oauth/token
          scopes:
            read:asset: Retrieve assets
            write:asset: Create and update assets
            read:assetgroup: Retrieve asset groups
            write:assetgroup: Create and update asset groups
            read:assetstatus: Retrieve asset statuses
            read:chargingstationmodel: Retrieve charging station models
            write:chargingstationmodel: Create and update charging station models
            write:network: Create and update networks
            write:sitepartner: Create and update site partners
            read:sitepartner: Retrieve site partners
            write:sitepartneruser: Create and update site partner users
            read:sitepartneruser: Retrieve site partner users
            read:networkaccessprofile: Retrieve network access profiles
            write:paymentprofile: Create payment profile
            write:onboardinglink: Create an onboarding link
            read:invoice: Retrieve an invoice
            write:session: Create or update a session
            read:session: Retrieve a session
            write:ticket: Create a ticket
            write:verificationcode: Send and confirm verification codes
            write:driver: Create and update drivers
            read:driver: Retrieve drivers
            write:token: Create and update tokens
            read:token: Retrieve tokens
            read:tokenvalue: Retrieve token by ID including its value
            write:invitecode: Create and update invite codes
            write:invitation: Create and update invitations
            read:invitation: Retrieve invitations
            read:payment_terminals_payment: Read payments from payment terminal
            abort:session: Abruptly end session
            read:paymentprofile: Retrieve payment profile from payment terminal
            write:ocpp: Sends request over OCPP
            write:ocpp.raw_request: Sends raw request over OCPP
            write:notification.email: Create and update email
            read:invoiceitem: Retrieve invoice item
            read:subscription: Retrieve subscription
            write:plugandcharge_enrollment: Update Plug and Charge enrollment status
            write:projects: Create and update projects
            read:projects: Retrieve projects
            write:project_stations: Create and update project stations
            write:panel: Create and update panels.
            read:panel: Retrieve panels.
            write:webhooks: Create, update, and delete webhooks
            read:webhooks: Retrieve webhooks

````