Pre-allocate numbers for offline emission
Invoice Series
Reserve Numbers
Pre-allocate N invoice numbers from a locked series so the mobile device can emit invoices offline with correct numbering.
POST
Pre-allocate numbers for offline emission
Overview
Pullscount sequential numbers off the series counter and hands back one reservation token per slot. The caller mobile device carries these tokens in local storage and spends them when creating invoices offline.
When the device later syncs the drafts with POST /invoices, it includes reservation_token in the body — the backend uses the reservation’s pre-allocated number_idx instead of incrementing the counter again. This keeps invoice numbers gapless even across long offline periods.
The series must be locked to the calling device first (see Lock Series). Calling this on an unlocked series, or from a different device than the one holding the lock, returns
series_not_locked_to_device.Body
Number of reservation slots to allocate. Maximum 50 per call — request again if the device needs more.
Response
Returns a list of reservation objects.Behavior after TTL
If a reservation expires without being consumed, the pre-allocated number becomes a gap in the series. Romanian fiscal practice accepts gaps when documented — keep the reservation TTL generous (default 30 days) and refresh the pool whenever the device comes back online. The cleanup cron flips expired rows tostatus = 'expired' but does not renumber downstream invoices.