Automatic Numbering for Invoices
Use the NumberingSequence API to assign invoice numbers automatically in A-Cube.
Step 1: Create a Numbering Sequence
Define sequences that specify the format and number series for invoices.
Creating a NumberingSequence
Send a POST request:
POST /numbering-sequences
With a JSON body (example):
{
"name": "SequenceName",
"format": "FV-%s",
"number": 0
}
- name: Unique sequence identifier
- format: Template for invoice numbers (use "
%s" as a placeholder for the number) - number: Last number used. Set
Nto have the next invoice numberedN+1(e.g., set0for starting at1)
The API returns a resource with a UUID that identifies the sequence. For details, see the NumberingSequence API.
Step 2: Use Numbering Sequences in Invoices
Insert the placeholder in your invoice:
autoincrement(<sequence_name>)
Alternatively, you can use the placeholder: autoNumeracja(<sequence_name>):
autoNumeracja(<sequence_name>)
Example
JSON:
{
// other fields in the invoice
"P_1": "2026-01-01",
"P_2": "autoincrement(SequenceName)",
...
}
or XML:
// other fields in the invoice
<P_1>2026-01-01</P_1>
<P_2>autoincrement(SequenceName)</P_2>
...
When you create an invoice, A-Cube replaces the placeholder with the next number: "FV-1", "FV-2", etc.
Notes
Some important notes to consider when using the automatic numbering feature:
- Counter increments automatically for every invoice successfully sent
- Counter resets to 1 at the start of the year
- If you were using a sequence for the past year, when the first invoice for the new year is sent, the new sequence will be created automatically
Formats
Exactly one of the following placeholders is required:
%ssimple number (1,2,3, ...)%0Xszero-padded number (e.g.,%04sfor0001,0002, ...).Xmust be a number between1and9.
Additional placeholders can be used:
%Yyear (e.g.,2026)%ytwo-digit year (e.g.,26for2026)