> ## 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.

# Preview Journal Entry

> Builds preview journal-entry sync records from caller-supplied invoice data for one invoice type and pay period.

Not available to API keys.

## OpenAPI

````yaml api-reference/openapi.json POST /hris/preview-journal-entry
openapi: 3.1.0
info:
  title: Toku API
  version: 1.0.0
servers:
  - url: https://api.toku.com
security:
  - bearerAuth: []
paths:
  /hris/preview-journal-entry:
    post:
      operationId: previewJournalEntry
      summary: Preview Journal Entry
      description: >-
        Builds preview journal-entry sync records from caller-supplied invoice
        data for one invoice type and pay period.


        Not available to API keys.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreviewJournalEntryRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewJournalEntryResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '409':
          description: Conflict
        '429':
          description: Response 429
components:
  schemas:
    PreviewJournalEntryRequest:
      type: object
      properties:
        clientId:
          type: string
          format: uuid
        invoices:
          type: array
          items:
            type: object
            properties:
              invoiceType:
                type: string
                enum:
                  - EOR_PEO
                  - CONTRACTOR
                  - W2_YEAR_END
                  - HRIS_PAYROLL
              payPeriod:
                type: string
              currency:
                type: string
              country:
                type: string
              lines:
                type: object
                additionalProperties:
                  oneOf:
                    - type: string
                    - {}
              rawRows: {}
              sourceUrl:
                type: string
                minLength: 1
              sourceTab:
                type: string
                minLength: 1
              parsedAt:
                oneOf:
                  - type: string
                    format: date-time
                  - type: string
            required:
              - invoiceType
              - payPeriod
              - currency
              - lines
              - rawRows
              - sourceUrl
              - sourceTab
              - parsedAt
          minItems: 1
          description: >-
            NOTE(ck): z.instanceof(Decimal) has no contract form; TGA still
            checks it

            NOTE(ck): a .transform() rule on a nested schema is not mirrored
            here; TGA still enforces it

            NOTE(ck): a .transform() rule is not mirrored here; TGA still
            enforces it
      required:
        - clientId
        - invoices
    PreviewJournalEntryResponse:
      type: object
      properties:
        previews:
          type: array
          items:
            type: object
            properties:
              syncId:
                type: string
              docNumber:
                type: string
              currency:
                type: string
              country:
                type: string
              groupingMode:
                type: string
                enum:
                  - COMBINED
                  - PER_COUNTRY
                  - PER_CURRENCY
              groupKey:
                type: string
              groupLabel:
                type: string
              retryCount:
                type: integer
              syncStatus:
                type: string
                enum:
                  - FAILED
                  - PREVIEWED
                  - PUSHING
                  - REVERSED
                  - SUCCESS
              qboJournalEntryId:
                type:
                  - string
                  - 'null'
              journalEntry:
                type: object
                properties:
                  TxnDate:
                    type: string
                  CurrencyRef:
                    type: object
                    properties:
                      value:
                        type: string
                    required:
                      - value
                  PrivateNote:
                    type: string
                  DocNumber:
                    type: string
                  Line:
                    type: array
                    items:
                      type: object
                      properties:
                        Amount:
                          type: string
                        DetailType:
                          const: JournalEntryLineDetail
                        Description:
                          type: string
                        JournalEntryLineDetail:
                          type: object
                          properties:
                            PostingType:
                              type: string
                              enum:
                                - Debit
                                - Credit
                            AccountRef:
                              type: object
                              properties:
                                value:
                                  type: string
                              required:
                                - value
                          required:
                            - PostingType
                            - AccountRef
                      required:
                        - Amount
                        - DetailType
                        - Description
                        - JournalEntryLineDetail
                required:
                  - TxnDate
                  - CurrencyRef
                  - PrivateNote
                  - DocNumber
                  - Line
              totalDebits:
                type: string
              totalCredits:
                type: string
              balanced:
                type: boolean
              heldForReview:
                type: boolean
            required:
              - syncId
              - docNumber
              - currency
              - country
              - groupingMode
              - groupKey
              - groupLabel
              - retryCount
              - syncStatus
              - qboJournalEntryId
              - journalEntry
              - totalDebits
              - totalCredits
              - balanced
              - heldForReview
      required:
        - previews
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
````
