Create Custom Auto-numbering Schemes
Users can use the Update Field Metadata API to create custom auto-numbering schemes to replace the default schemes for the Name field of the following object types:
-
Invoice
-
InvoiceItem
-
InvoiceItemDetail
-
CreditMemo
-
CreditMemoItem
-
CreditMemoItemDetail
-
DebitMemo
-
DebitMemoItem
-
PaymentApplication
-
PaymentApplicationItem
Auto-number Components
Please refer to the following table about different types of autonumbering scheme components:
COMPONENT |
FORMAT |
DESCRIPTION |
EXAMPLE |
Object Type Prefix |
The object type prefix |
Invoice: INV Order: O Credit Memo: CM Payment Application: PA | |
Year |
{YYYY} Or {YY} |
The year the record was created. Often formatted as YYYY. |
YYYY: 2024 YY: 24 |
Month |
{MM} |
The month the record was created. |
MM: 06 (June) |
Day |
{DD} |
The day of the month the record was created |
DD: 08 |
Hour |
{HH} |
The hour the record was created. Often formatted as HH. |
14 (2pm) |
Minue |
{mm} |
The minute the record was created. Often formatted as mm. |
30 |
Second |
{ss} |
The second the record was created. Often formatted as ss. |
45 |
Sequential Number |
{0000} |
A unique sequential number that increases with each new record. The number of 0 indicates the minimum number of digits in the sequential number.
An optional Start Value ( | {0000} with a start value 222. |
API Example
Here is an API example that sets up a custom scheme for the Auto-numbering of Invoice Numbers in the Invoice's Name field:
curl --location --request PATCH 'https://api.perftest.nue.io/metadata/objects/Invoice/fields/name' \
--header 'Content-Type: application/json' \
--header 'nue-api-key;' \
--data '{
"name": "name",
"autoNumberSetting": {
"displayFormat": "INV-{YYYY}-{MM}-{DD}*{0000}",
"startValue": 2000
}
}'
Once this custom scheme is established, the invoice numbers in the subsequent billing job will follow this format:: INV-2024-07-11*2001.