/v1/payment, appended to the gateway base URLs listed in the API reference introduction.
Key concepts
- Payment file — the generated BACS file for one completed pay run, identified by its payroll configuration, tax year, pay frequency, and period. It carries a
status, summary totals (records, employees, total amount), and a downloadable artefact with a time-limiteddownloadUrl. - Payment file status — the canonical outcome of generation:
GENERATED(file produced for every employee),PARTIAL_SUCCESS(file produced for some, others need attention),FAILED(no file produced),RETRYING(a retry is in progress), orSUBMITTED. Always branch on this field, never on the HTTP status code. - Affected employees — when the status is
FAILEDorPARTIAL_SUCCESS,failure.affectedEmployeeslists each employee blocking the file, with one validation issue per failed field. - Payment format — a (method, format, file format) combination such as BACS Standard 18 as
txtor BACS Barclays astxtorcsv. Each format advertises itssupportedFileFormats;fileFormatdefaults totxtwhen omitted. - Payment configuration — the per-organisation settings that drive file generation: the chosen method, format, and file format, plus the BACS source bank account (sort code, account number) and service user number.
- Payment reference — an optional expression on the configuration that builds each file’s reference from static text and tokens such as
{payDate},{year},{period},{frequency}, and separators. AreferenceDateFormatenum (defaultDMY_SLASH) controls how date tokens render.
API structure
Payment files
Fetch the file for a pay run withGET /file/run/{payrollConfigId}/year/{year}/frequency/{frequency}/period/{period}. The response’s file block is non-null when a downloadable artefact exists (GENERATED, SUBMITTED, PARTIAL_SUCCESS), and the failure block is non-null when employees were excluded (FAILED, PARTIAL_SUCCESS) — both appear together on a partial success.
Retry
Queue a regeneration with refreshed employee data usingPOST /file/run/{payrollConfigId}/year/{year}/frequency/{frequency}/period/{period}/retry. The file must currently be FAILED or PARTIAL_SUCCESS; the retry is accepted asynchronously with a 202 and the status moves to RETRYING while it processes.
Available payment configurations
List the (method, format, file format) combinations an organisation can configure withGET /available/config.
Organisation payment configuration
Manage the configuration at/config/{payrollConfigId}: create it with POST, then read, replace, or remove it with GET, PUT, and DELETE on the same path.
Typical workflow
- Call
GET /available/configto see which payment formats and file formats you can use. - Create the organisation’s configuration with
POST /config/{payrollConfigId}, supplying the method, format, BACS account details, and optionally a reference expression. - Complete a pay run in Flow Payroll — the service generates the payment file for it.
- Fetch the file with
GET /file/run/{payrollConfigId}/year/{year}/frequency/{frequency}/period/{period}and branch onstatus. - If the status is
FAILEDorPARTIAL_SUCCESS, correct the employees listed infailure.affectedEmployees, then queue a regeneration withPOST .../retry. - Download the file from
file.downloadUrland upload it to your bank.
Notes and best practices
The
status field in the 200 response body is the canonical outcome. Resource state is never reported through 4xx/5xx codes — a 500 means a server-side failure, not a failed file.- Download links expire at
file.downloadUrlExpiresAt. Fetch the payment file again to obtain a fresh link. - Use
csvas thefileFormatonly when it appears insupportedFileFormatsfor the chosen method and format. - A retry against a file that is not
FAILEDorPARTIAL_SUCCESSis rejected with a400. createdByisSYSTEMfor the first generation andSYSTEM_REGENfor automatic recovery regenerations, so you can tell how a file version came to exist.externalReferenceis a forward-compatibility placeholder for future API-based payment flows and is always null today.
Authentication
Every request needs anX-Auth-Token header, and credentials with access to more than one organisation also send X-Org-Id — see Authentication. Responses use the shared envelope described in Response format.