Describe your bank's own payment file — its columns, their order and how each value is written — with the Custom format.
When your bank's bulk payment import isn't one of the listed formats (Standard 18, Barclays, NatWest, Allica Bank), set format to Custom and send the file's layout as fileLayout on create or update. Every payment file for the pay schedule is then written in it.
Example
{
"method": "BACS",
"format": "Custom",
"reference": "SAL {period}",
"bacs": { "sortCode": "123456", "accountNumber": "12345678" },
"fileLayout": {
"name": "Our bank's bulk payments",
"extension": "csv",
"rowFormat": "Delimited",
"delimiter": ",",
"headingRow": false,
"columns": [
{ "field": "PayeeSortCode", "sortCode": "Dashed" },
{ "field": "PayeeAccountNumber", "accountNumber": "Digits" },
{ "field": "PayeeAccountNameAsEntered", "characterSet": "Bacs", "maxLength": 18 },
{ "field": "Amount", "amount": "Pounds" },
{ "field": "Blank" },
{ "field": "Reference", "characterSet": "Bacs", "maxLength": 18 }
]
}
}That layout writes one row per payment:
30-91-54,1335816,Mrs Leona Macauley,927.71,,SAL 8How a layout works
- The layout's
extension(csvortxt) is the file format;fileFormatis not needed. rowFormatisDelimited, with values separated bydelimiter(a comma when left out), orFixedWidth, with every column padded to itswidth.columnslists the row's columns in order. Each names afield:PayeeSortCode,PayeeAccountNumber,PayeeAccountName(the name in upper-case Bacs characters),PayeeAccountNameAsEntered,Amount,Reference,PaymentDate,EmployeeId,Literal(fixed text) orBlank.- A column takes only the options for its field:
sortCode(Digits,Dashed,Spaced),accountNumber(PaddedToEight,Digits),amount(Pounds,PoundsTrimmed,Pence),dateFormatforPaymentDate,literalforLiteral, plusheading,case,characterSet,trim,maxLength,width,alignandpad. Options left out take their defaults. - A layout needs exactly one
PayeeSortCode,PayeeAccountNumberandAmountcolumn, and a name column, and a heading on every column whenheadingRowis true. - Limits: 1 to 100 columns, text up to 100 characters, a delimiter up to 5 characters,
widthandmaxLength1 to 1000. A fixed-width sort code, account number or amount column must be wide enough for every valid payment: 6 (8 with separators), 8, and 11 (10 in pence).
Starting from a bank format
List available payment configurations returns fileLayouts on each format: that format's own layout, with a stable id such as barclays-csv, ready to copy into a Custom layout and adjust. A pay schedule's own layout answers id: null.
Changing or removing a layout
- An update without
fileLayoutkeeps the stored layout. - Changing
formataway fromCustomremoves it;fileLayoutwith any other format is refused. - A changed layout makes the latest locked pay run's file out of date, as a changed bank does: rebuild it to get it in the new layout. Renaming the layout changes nothing in the file.
When a layout is refused
An invalid layout answers 400 (createOrganisationPaymentConfigInvalidFileLayout or updateOrganisationPaymentConfigInvalidFileLayout) with one entry in validationIssues per problem. Each names the field (for example fileLayout.columns[2].width, counting from zero) and a reasonToken to branch on. The reason text may change; the tokens do not.
reasonToken | Meaning |
|---|---|
fileLayoutValueRequired | A required value is missing |
fileLayoutValueNotAllowed | A value is not one of those allowed |
fileLayoutColumnsOutOfRange | Fewer than 1 or more than 100 columns |
fileLayoutNeedsExactlyOneColumn | Not exactly one sort code, account number or amount column |
fileLayoutNeedsNameColumn | No name column |
fileLayoutDelimiterInvalid | The delimiter is empty, too long, or holds a quote or line break |
fileLayoutHeadingRowNotAllowed | A fixed-width layout with a heading row |
fileLayoutColumnNeedsWidth | A fixed-width column without a width |
fileLayoutColumnNeedsHeading | A column without a heading, in a layout with a heading row |
fileLayoutColumnNeedsLiteral | A Literal column without its text |
fileLayoutLengthOutOfRange | A width or maximum length outside 1 to 1000 |
fileLayoutColumnTooNarrow | A fixed-width figure column too narrow for a valid payment |
fileLayoutTextTooLong | A name, heading or literal over 100 characters |
fileLayoutPadInvalid | A pad that is not a single character |
New values may be addedThe layout's sets, such as
field, may gain values. Treat one you don't recognise as unknown rather than failing: show it by name, and send it back unchanged.
