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

# Get the latest journal for a pay run

> Return the most recent journal version for a pay run, or an empty result if none has been generated yet.



## OpenAPI

````yaml /api-reference/specs/journal.json get /journals/latest
openapi: 3.0.1
info:
  title: Journal Service
  description: Journal API for FlowPayroll
  version: v1
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1/journal
security:
  - X-Auth-Token: []
    X-Org-Id: []
tags:
  - name: Journals
    description: >-
      The accounting journals produced from each finalised pay run: list them,
      retrieve the latest or a specific version for a pay run, review history,
      rebuild or reissue, and download exports.
  - name: Journal templates
    description: >-
      Define how a pay run becomes an accounting journal. Create, update, clone,
      preview (as data, CSV, or PDF), import, export, and view the history of
      templates.
  - name: Pay element mappings
    description: Map each pay element to the nominal code it posts to within a template.
  - name: Control account mappings
    description: >-
      Map control accounts (net pay, PAYE, NI, pension, and other liabilities)
      to nominal codes within a template.
  - name: Split dimensions
    description: >-
      Analysis dimensions such as department or cost centre that split journal
      lines into tracking categories or account-code segments.
  - name: Split value mappings
    description: >-
      Map each value of a split dimension to its tracking code or account
      segment.
  - name: Org journal settings
    description: Read and update the organisation-level journal defaults.
  - name: Journal export metadata
    description: >-
      Reference data for building templates: export presets, date-format
      presets, narration and reference tokens, and account-code separators.
paths:
  /journals/latest:
    get:
      tags:
        - Journals
      summary: Get the latest journal for a pay run
      description: >-
        Return the most recent journal version for a pay run, or an empty result
        if none has been generated yet.
      operationId: GetLatestJournalForPayRun
      parameters:
        - name: payrollConfigId
          in: query
          schema:
            type: string
        - name: taxYear
          in: query
          schema:
            type: integer
            format: int32
        - name: taxPeriod
          in: query
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JournalResponseResponseBody'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
components:
  schemas:
    JournalResponseResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          allOf:
            - $ref: '#/components/schemas/JournalResponseContentResponse'
          nullable: true
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
      additionalProperties: false
    ObjectResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          allOf:
            - $ref: '#/components/schemas/ObjectContentResponse'
          nullable: true
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
      additionalProperties: false
    MessageWithTokenResponse:
      type: object
      properties:
        text:
          type: string
        token:
          type: string
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    JournalResponseContentResponse:
      type: object
      properties:
        data:
          allOf:
            - $ref: '#/components/schemas/JournalResponse'
          nullable: true
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssue:
      type: object
      properties:
        field:
          type: string
        reason:
          type: string
        reasonToken:
          type: string
        reasonTokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    ObjectContentResponse:
      type: object
      properties:
        data:
          nullable: true
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssueArgument:
      type: object
      properties:
        name:
          type: string
        value:
          nullable: true
      additionalProperties: false
    JournalResponse:
      type: object
      properties:
        id:
          type: string
          description: Journal identifier.
        organisationId:
          type: string
          description: Organisation the journal belongs to.
        payrollConfigId:
          type: string
          description: Payroll configuration (pay schedule) of the pay run.
        taxYear:
          type: integer
          description: Tax year of the pay run.
          format: int32
        taxPeriod:
          type: integer
          description: Tax period of the pay run within the tax year.
          format: int32
        payDate:
          type: string
          description: Pay date of the pay run.
        frequency:
          type: string
          description: Pay frequency of the payroll configuration.
        version:
          type: integer
          description: >-
            Version of the journal within its pay run; a reissue creates a new
            version.
          format: int32
        templateId:
          type: string
          description: Journal template the lines were generated from.
        sumDebit:
          type: number
          description: "Stored running total of the journal's debit lines. On a settled journal it\r\nequals the sum of the lines (and `reconciliation.sumDebit`); while a\r\npay run is still calculating, prefer `reconciliation`, which is\r\ncomputed from the very lines in the same response."
          format: double
        sumCredit:
          type: number
          description: Stored running total of the journal's credit lines. See `sumDebit`.
          format: double
        isBalanced:
          type: boolean
          description: Whether the journal's debits equal its credits.
        isFinalised:
          type: boolean
          description: Whether the journal is a finalised, immutable snapshot.
        failureReason:
          type: string
          description: Why generation failed, when it did; null otherwise.
          nullable: true
        createdBy:
          type: string
          description: Who created this journal version.
        createdDate:
          type: string
          description: When this journal version was created (UTC).
        updatedBy:
          type: string
          description: Who last updated the journal.
        updatedDate:
          type: string
          description: When the journal was last updated (UTC).
        settled:
          type: boolean
          description: "Whether this journal has incorporated every payslip change the pay run\r\ncurrently reports. False means the figures are still moving: read again\r\nrather than assert against them. A finalised journal is always settled —\r\nit is an immutable snapshot. On the organisation-wide list the run is not\r\nconsulted, so this reports finalisation only; use the single-journal or\r\npay-run endpoints for the live answer."
        incorporatedPayslipVersion:
          type: string
          description: "The pay-run payslip token this journal has fully incorporated. Compare\r\nsuccessive reads to see progress. Empty on a journal that predates the\r\ntoken, where `settled` falls back to the previous behaviour."
      additionalProperties: false
    ContentMetadataResponse:
      type: object
      properties:
        dateFormat:
          type: string
        dateTimeFormat:
          type: string
        paginationToken:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    X-Auth-Token:
      type: apiKey
      description: FlowPayroll JWT (raw token, no Bearer prefix)
      name: X-Auth-Token
      in: header
    X-Org-Id:
      type: apiKey
      description: >-
        Organisation to scope the request to. Required when the principal can
        access more than one organisation; optional for single-organisation
        principals (the authorizer resolves it automatically).
      name: X-Org-Id
      in: header

````