generate_progressivo_invio
Generate a unique ProgressivoInvio identifier for Italian e-invoice transmission. Use an optional prefix and sequence to meet SDI uniqueness requirements.
Instructions
Generate a ProgressivoInvio identifier for the DatiTrasmissione block.
Use this as step 2 in the invoice generation workflow, before build_transmission_header(). The SDI requires each ProgressivoInvio to be unique per transmitter Partita IVA — in production, pass an explicit monotonically increasing sequence number; use the random default only for testing.
prefix (optional): alphabetic 1–3 char prefix, e.g. 'INV' → 'INV00001'. sequence (optional): integer 1–9999999; random 5-digit value if omitted. Total length must not exceed 10 characters.
On success returns {'progressivo_invio': str, 'length': int}. On failure (invalid prefix) returns {'error': ''}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prefix | No | Optional alphabetic prefix (max 3 chars) to prepend to the sequence number. E.g. 'INV' → 'INV00001'. Total length must not exceed 10 chars. | |
| sequence | No | Explicit sequence number (1–9999999). If omitted, a random 5-digit number is generated. Callers should track their own sequence in production. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||