Turn finalised pay runs into accounting journals — configure templates and mappings, then generate, version, and export the journals for each pay run.
Journal API overview
The Journal API turns a finalised pay run into a balanced, double-entry
accounting journal that you can post to your accounting system (for example
Xero or Sage) or download as a CSV or PDF. You control the shape of the
journal with a template: which nominal codes each pay element and control
account posts to, how lines are analysed by department or cost centre, and how
the journal is narrated, referenced, dated, and formatted for export.
Key concepts
- Journal template — the reusable definition of how a pay run becomes a
journal. It holds the nominal (ledger) structure, account-code composition,
narration and reference formats, date format, and export format. An
organisation can keep more than one template (for example, a summary journal
and a detailed one). - Pay element mapping — within a template, maps each pay element (basic
pay, overtime, bonus, employer pension, and so on) to the nominal code it
posts to. - Control account mapping — maps each control account (net pay, PAYE,
employee and employer NI, pension, student loan, and other liabilities) to
its nominal code. - Split dimension — an optional analysis dimension, such as department or
cost centre, sourced from employee tags. Split dimensions break each journal
line down into tracking categories (for example, Xero tracking) or
account-code segments. - Split value mapping — maps a single value of a split dimension (for
example, the "Warehouse" department) to its tracking code or account segment. - Journal — the journal produced for a specific pay run. Journals are
versioned: rebuilding or reissuing a pay run's journal creates a new version,
and the full history is retained. - Export — the rendered output of a journal in a chosen format (CSV, PDF,
or an accounting-provider layout), available as a direct download or a
time-limited download link.
API structure
Journal templates
Create, retrieve, update, clone, and delete templates. Preview a template
against a pay run as structured data, CSV, or PDF before you rely on it. Export
a template's definition and import it into another organisation, or import just
its mappings. Every change is recorded in the template's history.
Pay element mappings and control account mappings
Attach nominal codes to the pay elements and control accounts a template uses.
Both are simple key-addressed collections: list them for a template, and create,
update, retrieve, or delete an individual mapping.
Split dimensions and split value mappings
Add analysis dimensions to a template and map each of their values. Split
dimensions are ordered by sequence; split values are addressed by the value key
within a dimension.
Journals
List the journals for an organisation, retrieve a single journal, and get the
latest journal or all versions for a given pay run. Rebuild a pay run's journal
(regenerated from the pay run's frozen payslip snapshot) or reissue it, and
review a journal's history. Download an export in a given format, or request a
time-limited download link.
Organisation journal settings
Read and update the organisation-level defaults that apply across journals.
Export metadata
Reference data used to build templates: export presets, date-format presets,
narration and reference tokens for the template's token builders, and the
available account-code separators.
Typical workflow
- Create a template and set its export format, date format, narration, and
reference. Use the export metadata
endpoints to populate the available presets, tokens, and separators. - Map your pay elements and control accounts to nominal codes.
- Optionally add split dimensions (for example, department) and map their
values to tracking codes or account segments. - Preview the template against a pay run — as data, CSV, or PDF — and adjust
the mappings until the journal balances the way you expect. - Finalise the pay run. A journal is generated for the pay run; retrieve the
latest journal for that pay run, or list its versions. - Download the export (or fetch a download link) in the configured format.
- Rebuild or reissue the journal if the template or the underlying pay data
changed, then download the new version.
Notes and best practices
- Journals are immutable snapshots. To reflect a change, rebuild or reissue
the pay run's journal rather than editing an existing version — the previous
version is retained in history. - Preview before you finalise. The CSV and PDF preview endpoints render the
exact output your accounting system will receive. - Use pagination when listing journals or template history for organisations
with many pay runs.
Authentication
All Journal API requests use the standard Flow Payroll authentication — see
Getting started and
Authentication.
