Seed / raise many tuples at once (all-or-nothing)
const url = 'https://api.emite.cr/v1/tenants/example/sequences/batch';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"entries":[{"branchId":"example","terminalId":"example","docType":"01","nextConsecutive":1}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.emite.cr/v1/tenants/example/sequences/batch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "entries": [ { "branchId": "example", "terminalId": "example", "docType": "01", "nextConsecutive": 1 } ] }'Applies every entry in a single transaction; any decrease (or any other error of the single-tuple operation) rolls back the whole batch. Returns the counter cells after the change, in the order of entries.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Tuples to seed (all-or-nothing).
object
Branch UUID.
Terminal UUID (must belong to the branch).
Hacienda document type (01..10).
Number the NEXT emitted document will carry. Can only be raised, never lowered (the server rejects a value at or below the current floor with SEQUENCE_CANNOT_DECREASE).
Responses
Section titled “Responses”object
Branch UUID.
3-digit branch code (001).
Branch display name.
Terminal UUID.
5-digit terminal code (00001).
Terminal display name.
Hacienda document type (01..10).
Hacienda document type name (always Spanish, never translated).
Last number treated as used (0 if never emitted for this tuple).
Number the next document will carry (= lastConsecutive + 1).
True when this tuple already has a counter row with last_consecutive > 0. Advisory only (raising the counter is always allowed); the UI shows a "affects future docs only" hint.
Example
[ { "branchCode": "001", "terminalCode": "00001", "docType": "01" }]Missing or invalid JWT / API key
Tenant boundary violation or insufficient scope.
At least one entry is at or below its current floor.