Document fields
Add your own fields, such as a PCO number, terms or salesperson, to quotes, invoices, orders and notes, and print them with your templates.
Document fields are extra details your documents carry that Anchor does not have built in, for example a PCO number, Terms such as "50% Deposit Required", or the Salesperson. Manage them under Settings → Document fields.
Adding a field
Click Add field and choose:
| Setting | What it does |
|---|---|
| Label | What prints on the document, e.g. PCO (max 40 characters) |
| Type | Short text (one line), Long text (several lines; suits a section), Choice (one of a list of options) or Team member (pick someone in your organisation; the document prints their name) |
| Options | Choice fields only: one option per line |
| Default | The value new documents start with, e.g. 50% Deposit Required. Team member fields have no default |
| Appears on | Quotes, invoices, credit notes, sales orders, delivery notes, purchase orders and debit notes. Customer statements are generated, so they have no document fields |
Each field gets a fixed key from its label (pco for PCO, pco_number for PCO number). Renaming the label later does not change the key, so templates and documents keep working. An organisation can have up to 30 active fields.
Filling in a field
The create and edit forms for quotes, invoices, credit notes, sales orders, purchase orders and debit notes show the fields for that document type under the customer and reference. Record a delivery on a sales order shows the delivery note's fields. New documents start with each field's default; clear it if it does not apply. Choice fields offer their options and Team member fields list your organisation's members; the document stores the option or the member's name as printed.
Only active fields for that document type can be filled in. A value for a field that was archived later stays on the document and keeps printing.
Carried to the next document
When a document is made from another one, its document fields come along:
- a quote turned into an invoice or a sales order;
- a sales order invoiced, or delivered (Record a delivery shows the order's values; change them there if the delivery note needs something else);
- a recurring invoice template generating an invoice.
Only fields that also appear on the new document type are copied. A field the source has no value for gets its default.
Recurring invoices
A recurring invoice template has the invoice fields too. Values you enter are copied onto every invoice it generates; fields you leave untouched get their default when each invoice is made, so a changed default reaches future invoices.
CSV import and export
Settings → Import & Export exports invoices with a custom.<key> column for each invoice field (for example custom.pco). Importing invoices maps custom.<key> columns, or a column named like the field's label, to the field. For a multi-line invoice the first row's values count; empty cells get the field's default, and a choice value must be one of its options.
Sent invoices
When an invoice is sent, the field labels are saved with it. Renaming a field later does not change how a sent invoice prints.
Printing a field
Open a template under Settings → Templates:
- Details and customer → Detail fields lists your fields for that document type next to the built-in details (number, dates, reference). Switch a field on to print it in the details block, drag it into place and, if you like, give it a different label.
- Sections and text lists them too. A section prints the value under its own heading; this suits long text.
- In any template text (tagline, notes, bank details, payment instructions, closing text) use
{{custom.<key>}}, for example{{custom.terms}}.
A field prints only when the document has a value; empty fields leave no gap. One template can place up to 10 fields in its details and 10 in its sections.
Documents store the value as it was printed. Changing a field's options, or a team member's name, does not change documents you already sent.
Archiving
Fields are never deleted. Archive stops a field appearing on new documents and in the template editor's lists; documents that have a value keep printing it. Turn on Show archived to see them and Restore one.
API
| Endpoint | Method | Description |
|---|---|---|
/api/v1/document-fields | GET | Active fields in order (?archived=true includes archived ones) |
/api/v1/document-fields | POST | Create a field (label, fieldType, documentTypes; optional key, options, defaultValue, sortOrder) |
/api/v1/document-fields/{id} | GET | One field |
/api/v1/document-fields/{id} | PATCH | Update a field; archived: true archives it, false restores it. The key cannot change |
Recurring invoice templates take customFields on POST /api/v1/recurring-invoices, POST /api/v1/recurring (invoice templates) and their PATCH routes. Documents take values in customFields when they are created or updated (POST/PATCH on quotes, invoices, credit notes, sales orders, purchase orders and debit notes; POST /api/v1/delivery-notes), for example "customFields": { "pco": "Jan Botha", "terms": "50% Deposit Required" }. On create, fields you leave out get their default. On update, only the keys you send change; null or "" clears one. Choice fields must get one of their options; team member fields take the member's user ID or name and store the name. Documents return customFields as stored.
MCP Tools
AI agents connected to Anchor can use list_document_fields, get_document_field, create_document_field, update_document_field, archive_document_field and restore_document_field. To print a field, an agent adds custom:<key> to a template layout's meta.fields or sections with update_document_template. The create and update tools for quotes, invoices, credit notes, sales orders and debit notes, create_purchase_order, create_delivery_note and the recurring template tools take customFields the same way as the API, and import_csv_data reads custom.<key> columns for invoices. On Settings → Document fields, in-page agents get the list, create, update, archive and restore tools.