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

# Self Serve Get Invoice Details

> Returns an invoice for admin review with display line items, USD equivalent, parties and payout read model.

Required scope: `invoices:read`. It also needs `banking:read`, `compensation:read`.

## OpenAPI

````yaml api-reference/openapi.json GET /hris/self-serve-get-invoice-details
openapi: 3.1.0
info:
  title: Toku API
  version: 1.0.0
servers:
  - url: https://api.toku.com
security:
  - bearerAuth: []
paths:
  /hris/self-serve-get-invoice-details:
    get:
      operationId: selfServeGetInvoiceDetails
      summary: Self Serve Get Invoice Details
      x-toku-required-scope: invoices:read
      description: >-
        Returns an invoice for admin review with display line items, USD
        equivalent, parties and payout read model.


        Required scope: `invoices:read`. It also needs `banking:read`,
        `compensation:read`.
      parameters:
        - name: invoiceID
          in: query
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfServeGetInvoiceDetailsResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '409':
          description: Conflict
        '429':
          description: Response 429
components:
  schemas:
    SelfServeGetInvoiceDetailsResponse:
      type: object
      properties:
        invoice:
          type: object
          properties:
            invoicePaymentID:
              type: string
            invoiceVersion:
              type: string
            approvalRevision:
              type:
                - number
                - 'null'
            invoiceNumber:
              type:
                - string
                - 'null'
            invoiceDate:
              type:
                - string
                - 'null'
            dueDate:
              type:
                - string
                - 'null'
            totalAmount:
              type:
                - string
                - 'null'
            currencyCode:
              type:
                - string
                - 'null'
            status:
              type:
                - string
                - 'null'
            contractorName:
              type:
                - string
                - 'null'
            contractorEmail:
              type:
                - string
                - 'null'
            submissionTimestamp:
              type:
                - string
                - 'null'
            reason:
              type:
                - string
                - 'null'
            rejectionReason:
              type:
                - string
                - 'null'
            autoApproved:
              type:
                - boolean
                - 'null'
            lineItems:
              type:
                - array
                - 'null'
              items:
                type: object
                properties:
                  invoicePaymentLineItemID:
                    type:
                      - string
                      - 'null'
                  description:
                    type:
                      - string
                      - 'null'
                  quantity:
                    type:
                      - number
                      - 'null'
                  unitPrice:
                    type:
                      - number
                      - 'null'
                  amount:
                    type:
                      - number
                      - 'null'
                  taxAmount:
                    type:
                      - number
                      - 'null'
                  discountAmount:
                    type:
                      - number
                      - 'null'
                  total:
                    type:
                      - number
                      - 'null'
                  category:
                    type:
                      - string
                      - 'null'
                  paymentMethodType:
                    type:
                      - string
                      - 'null'
                    enum:
                      - BANK_TRANSFER
                      - CRYPTO_WALLET
                      - null
                  hrisBankAccountID:
                    type:
                      - string
                      - 'null'
                  cryptoCurrency:
                    type:
                      - string
                      - 'null'
                  cryptoNetwork:
                    type:
                      - string
                      - 'null'
                  merchant:
                    type:
                      - string
                      - 'null'
                  spentAmount:
                    type:
                      - string
                      - 'null'
                  spentCurrencyCode:
                    type:
                      - string
                      - 'null'
                  fxRate:
                    type:
                      - string
                      - 'null'
                  expensedDate:
                    type:
                      - string
                      - 'null'
            billToSnapshot: {}
            notes:
              type:
                - string
                - 'null'
            createdAt:
              type:
                - string
                - 'null'
            updatedAt:
              type:
                - string
                - 'null'
            approvalRouting:
              type:
                - object
                - 'null'
              properties:
                invoiceVersion:
                  type:
                    - string
                    - 'null'
                steps:
                  type:
                    - array
                    - 'null'
                  items:
                    type: object
                    properties:
                      stepOrder:
                        type:
                          - number
                          - 'null'
                      kind:
                        type:
                          - string
                          - 'null'
                      approverName:
                        type:
                          - string
                          - 'null'
                      fallsBackToAdmins:
                        type:
                          - boolean
                          - 'null'
                      state:
                        type:
                          - string
                          - 'null'
                        enum:
                          - approved
                          - current
                          - waiting
                          - null
                      approvedByName:
                        type:
                          - string
                          - 'null'
                      approvedByOverride:
                        type:
                          - boolean
                          - 'null'
                currentStepOrder:
                  type:
                    - number
                    - 'null'
                requiredApprovals:
                  type:
                    - number
                    - 'null'
                approvalsCounted:
                  type:
                    - number
                    - 'null'
                waitingOn:
                  type:
                    - string
                    - 'null'
            attachments:
              type:
                - array
                - 'null'
              items:
                type: object
                properties:
                  id:
                    type:
                      - string
                      - 'null'
                  fileName:
                    type:
                      - string
                      - 'null'
                  fileKey:
                    type:
                      - string
                      - 'null'
                  fileSize:
                    type:
                      - number
                      - 'null'
                  mimeType:
                    type:
                      - string
                      - 'null'
                  uploadedAt:
                    type:
                      - string
                      - 'null'
            groupedTotals:
              type:
                - object
                - 'null'
              properties:
                bankTotals:
                  type:
                    - array
                    - 'null'
                  items:
                    type: object
                    properties:
                      currencyCode:
                        type:
                          - string
                          - 'null'
                      total:
                        type:
                          - string
                          - 'null'
                cryptoTotals:
                  type:
                    - array
                    - 'null'
                  items:
                    type: object
                    properties:
                      tokenSymbol:
                        type:
                          - string
                          - 'null'
                      networkName:
                        type:
                          - string
                          - 'null'
                      total:
                        type:
                          - string
                          - 'null'
            usdEquivalent:
              type:
                - number
                - 'null'
            submissionConversion:
              type:
                - object
                - 'null'
              properties:
                sourceCurrencyCode:
                  type:
                    - string
                    - 'null'
                targetAmount:
                  type:
                    - string
                    - 'null'
                targetCurrencyCode:
                  type:
                    - string
                    - 'null'
                rate:
                  type:
                    - string
                    - 'null'
                rateSource:
                  type:
                    - string
                    - 'null'
                rateTimestamp:
                  type:
                    - string
                    - 'null'
            isPaymentBatchEligible:
              type:
                - boolean
                - 'null'
            isTokuContractorCryptoInvoice:
              type:
                - boolean
                - 'null'
            billToName:
              type:
                - string
                - 'null'
            billToAddressLines:
              type:
                - array
                - 'null'
              items:
                type: string
            showTokuBranding:
              type:
                - boolean
                - 'null'
            billFrom:
              type:
                - object
                - 'null'
              properties:
                name:
                  type:
                    - string
                    - 'null'
                addressLines:
                  type:
                    - array
                    - 'null'
                  items:
                    type: string
                taxId:
                  type:
                    - string
                    - 'null'
                email:
                  type:
                    - string
                    - 'null'
                phone:
                  type:
                    - string
                    - 'null'
            isLegacyInvoice:
              type:
                - boolean
                - 'null'
            duplicateCandidates:
              type:
                - array
                - 'null'
              items:
                type: object
                properties:
                  invoicePaymentID:
                    type:
                      - string
                      - 'null'
                  invoiceNumber:
                    type:
                      - string
                      - 'null'
                  invoiceDate:
                    type:
                      - string
                      - 'null'
                  totalAmount:
                    type:
                      - string
                      - 'null'
                  currencyCode:
                    type:
                      - string
                      - 'null'
                  status:
                    type:
                      - string
                      - 'null'
                  matchType:
                    type:
                      - string
                      - 'null'
                    enum:
                      - EXACT_AMOUNT
                      - SIMILAR_AMOUNT
                      - null
          required:
            - invoicePaymentID
            - invoiceVersion
        payoutReadModel:
          type: object
          properties:
            source:
              type: string
              enum:
                - CANONICAL_PAYOUT
                - TOKEN_SETTLEMENT
                - LEGACY_CONTRACTOR_INVOICE
                - TRANSACTION_DETAILS
                - QUEUE_SETTLEMENT_REASON
                - STATUS_ONLY
            payoutStatus:
              type: string
              enum:
                - NOT_PAID
                - PARTIALLY_PAID
                - PAID
            canonicalAvailable:
              type: boolean
            warnings:
              type: array
              items:
                type: string
            legs:
              type: array
              items:
                type: object
                properties:
                  legType:
                    type: string
                    enum:
                      - FIAT
                      - CRYPTO
                  status:
                    type: string
                    enum:
                      - PENDING
                      - PAID
                      - FAILED
                      - CANCELLED
                  source:
                    type: string
                  amount:
                    type:
                      - string
                      - 'null'
                  expectedAmount:
                    type:
                      - string
                      - 'null'
                  currencyCode:
                    type:
                      - string
                      - 'null'
                  paidAt:
                    type:
                      - string
                      - 'null'
                  proofReference:
                    type:
                      - string
                      - 'null'
                  transactionHash:
                    type:
                      - string
                      - 'null'
                  transactionLink:
                    type:
                      - string
                      - 'null'
                  paymentRecordID:
                    type:
                      - string
                      - 'null'
                  destinationName:
                    type:
                      - string
                      - 'null'
                  destinationAddress:
                    type:
                      - string
                      - 'null'
                  destinationSnapshot: {}
                  tokenSymbol:
                    type:
                      - string
                      - 'null'
                  tokenAddress:
                    type:
                      - string
                      - 'null'
                  networkName:
                    type:
                      - string
                      - 'null'
                required:
                  - legType
                  - status
                  - source
          required:
            - source
            - payoutStatus
            - canonicalAvailable
            - warnings
            - legs
      required:
        - invoice
        - payoutReadModel
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
````
