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

# Record Numbering Reference

> Reference for DualEntry record codes: Record Numbering settings, default prefixes, when codes are assigned, draft and migration formats, and known limits.

A record code is the readable identifier DualEntry gives a record, such as `IN-0042` or `ACME-JE-0007`. It appears in the **Record code** column of record lists, in the record's page header and breadcrumb, and in the public API and MCP server. The **Record Numbering** tab of Organization Settings controls how codes are built. This page lists every setting, the default prefix for each record type, and the rules for when codes are assigned. For the setup steps, see [How to Set Up Record Numbering](https://docs.dualentry.com/accountants/platform-configuration/organization-settings/record-numbering.md).

## Record Numbering tab settings

The **Record Numbering** tab has one organization-wide toggle, a list of company prefixes, and a table with one row per record type. Only users with the **Administrator** role can edit it.

Settings on the **Record Numbering** tab:

| Setting | Type | Default | Description |
| - | - | - | - |
| **Number records uniquely by company** | Toggle | Off | When on, each company can keep its own sequence per record type, prefixed with its company prefix. When off, all companies share one sequence per record type. |
| **Prefix** (in **Company Prefix**) | Text, up to five letters or digits | None | The company's prefix in per-company codes. Must be unique across companies. Shown only while **Number records uniquely by company** is on. |
| **Pattern** | Ordered chips: **Company Prefix**, **Record Prefix**, **Record Number** | N/A | The order of the parts in every code, joined with a hyphen. **Company Prefix** appears only while **Number records uniquely by company** is on. |
| **Company Prefix** (per row) | Switch | N/A | Whether the record type uses per-company sequences. Shown only while **Number records uniquely by company** is on. |
| **Record Prefix** | Text, up to six characters | The default prefix for the record type | The record type's prefix. Required, and must be unique across record types. |
| **Padding** | Integer, 4–10 | 4 for a new sequence | The minimum number of digits in the record number. Shorter numbers get leading zeros; longer numbers are not cut. |
| **Starting Value** | Integer, at least 1 | 1 | The first number of a new sequence. Raised automatically to the current sequence's next number if it's lower. |
| **Preview** | Read-only | N/A | The code format the record type uses after you save. |

**Padding** and **Starting Value** can be set only when a row starts a new sequence, which happens when you change its **Record Prefix** or its **Company Prefix** switch. Each record type has one active sequence at a time.

## Default record prefixes

Every record type that receives a code has a default prefix. A new organization starts with one shared sequence per record type in the format `PREFIX-{number}`, with no leading zeros and a first number of 1, so the first invoice is `IN-1`.

Default prefix for each record type, as listed in the **Transaction Type** column:

| Record type | Default prefix |
| - | - |
| Allocation Journal | `AJ` |
| Allocation Schedule | `AS` |
| Amortizable Asset | `AMS` |
| Amortization | `AM` |
| Bank Transfer | `BT` |
| Bill | `BI` |
| Cash Sale | `CS` |
| Contract | `RC` |
| Contract Adjustment | `CADJ` |
| Contract Invoice | `CI` |
| Contract Termination | `CT` |
| Currency Revaluation | `CRV` |
| Currency Revaluation Action | `CRP` |
| Customer | `CU` |
| Customer Credit | `CC` |
| Customer Deposit | `CD` |
| Customer Payment | `CP` |
| Customer Prepayment | `CPP` |
| Customer Prepayment Application | `CPA` |
| Customer Refund | `CR` |
| Customer Statement | `ST` |
| Depreciation | `DEP` |
| Direct Expense | `DE` |
| Disposal | `DIS` |
| Fixed Asset | `FA` |
| Intercompany Journal Entry | `IJE` |
| Invoice | `IN` |
| Journal Entry | `JE` |
| Nexus | `NX` |
| Project | `PRJ` |
| Purchase Order | `PO` |
| Quote | `QT` |
| Recurring | `RR` |
| Revenue Recognition | `REV` |
| Revenue Recognition Batch | `RRB` |
| Sales Order | `SO` |
| Statistical Journal | `SJ` |
| Vendor | `VN` |
| Vendor Credit | `VC` |
| Vendor Payment | `VP` |
| Vendor Prepayment | `VPP` |
| Vendor Prepayment Application | `VPA` |
| Vendor Refund | `VR` |
| Withholding Tax Remittance | `WHTR` |

Invoices generated from a revenue contract use the **Contract Invoice** sequence; all other invoices use the **Invoice** sequence. Inventory fulfillments, receipts, transfers, and adjustments, and items, don't receive record codes.

## When a record gets its code

DualEntry assigns a record code when a record posts, not when it's saved. The rules below apply to every record type in the default prefix table.

* **Posting**: A record takes the next number in its sequence at the moment it posts, including when it posts after approval in an [approval workflow](https://docs.dualentry.com/accountants/platform-configuration/approval-workflows.md). A record waiting for approval has no code yet.
* **Drafts**: A draft shows a placeholder in the format `DRAFT-{prefix}-{record ID}`, such as `DRAFT-IN-935`, and doesn't use a number from the sequence. The placeholder is replaced by a real code when the draft posts.
* **Customers and vendors**: Customers and vendors are never drafted or posted, so they get their code when they're created.
* **Failed posts**: The number is reserved in the same database transaction that posts the record. If the post fails or is rolled back, the number is not used up.
* **Permanence**: Once a record has a code, the code never changes. Changing a prefix, the pattern, padding, or the **Number records uniquely by company** toggle affects only records that get their code afterward.
* **Per-company sequences**: When a record type uses per-company sequences, each company counts separately, so two companies can each have a record numbered `0001` behind different company prefixes.

## Records created before record codes and by migration

Records that existed before record codes were turned on, and records brought in by a migration import, get codes in fixed formats rather than from a sequence. These codes are permanent.

Code formats DualEntry assigns outside the normal sequence:

| Source | Format | Example | Notes |
| - | - | - | - |
| Posted record that existed before record codes were turned on | `PREFIX-{record ID}` | `IN-38810` | Built from the record type's default prefix and the record's internal ID. Before record codes, the app showed the same ID padded to six digits (`IN-038810`); the code drops those leading zeros. |
| Draft that existed before record codes were turned on | `DRAFT-{prefix}-{record ID}` | `DRAFT-IN-935` | Takes a real code from the sequence when it posts. |
| Record created by a migration import, such as a QuickBooks, Xero, or Sage 50 migration | `MIGR-PREFIX-{record ID}` | `MIGR-IN-51234` | Doesn't use a number from the sequence. Records synced from Stripe use the normal sequence. |

When record codes are turned on for an organization that already has records, each record type's sequence starts one above the highest existing record ID of that type. New codes therefore continue after the codes of existing records and never repeat one of them.

## Known limits

These limits apply to record codes on every record type:

* **No yearly or monthly reset**: Record numbers keep counting up. A sequence doesn't restart at a new fiscal year, calendar year, or month, and a code can't include the date.
* **Increment of one**: Each new record takes the next whole number. The **Record Numbering** tab has no setting to count by more than one.
* **Company prefix required for per-company codes**: If a record type uses per-company sequences and the record's company has no prefix, the post fails with `Company abbreviation is required when pattern includes {company}.` Set the company's prefix and post again.
* **Customers and vendors share one sequence**: Customer and vendor codes can't use per-company sequences.
* **Reserved prefixes**: A code can't start with `MIGR` or `DRAFT`, because DualEntry uses those prefixes for migration codes and draft placeholders.
* **No renumbering**: DualEntry doesn't renumber existing records. A change to the pattern or a prefix applies only to records that get their code afterward.

## Record codes in the API and MCP server

Record codes are available outside the app wherever records are read or searched.

* **Public API**: Records such as invoices, bills, and journal entries return the code in the `code` field, a string that is `null` when the record has no code and that holds the placeholder for drafts. List endpoints for these records accept a `code` filter with one or more codes. See the [API reference](https://docs.dualentry.com/developers/api/resources-v2/index.md).
* **MCP server**: The `search_records` tool takes a `code` argument, and `get_record_by_number` accepts a record code such as `JE-0042`. Paste a code from the app into a prompt and the assistant can find the record. See the [MCP integration](https://docs.dualentry.com/accountants/ai-automation/mcp/mcp-integration.md) page.
* **CLI**: The DualEntry CLI doesn't show record codes in its output.

## Related

* [How to Set Up Record Numbering](https://docs.dualentry.com/accountants/platform-configuration/organization-settings/record-numbering.md): choose shared or per-company numbering and edit prefixes, padding, and starting values
* [Organization Settings](./index): the other tabs on the settings page
* [Journal entries: record numbering](https://docs.dualentry.com/accountants/core-financials/general-ledger/journal-entries.md#record-numbering): the internal record number, which is separate from the record code
* [Audit Trail and Compliance](https://docs.dualentry.com/accountants/platform-configuration/audit-trail-and-compliance.md): show auditors that every posted record is retained


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.