Seed initial consecutivos (production) for a provider migration
const url = 'https://api.emite.cr/v1/partner/tenants/example/sequences/seed';const options = { method: 'PUT', headers: {'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/partner/tenants/example/sequences/seed \ --header 'Content-Type: application/json' \ --data '{ "entries": [ { "branchId": "example", "terminalId": "example", "docType": "01", "nextConsecutive": 1 } ] }'All-or-nothing batch: if one entry fails, none is applied. Counters only go up — an entry at or below a number already used answers 409 SEQUENCE_CANNOT_DECREASE (params.current); MensajeReceptor types (05/06/07) only on the default terminal (400 SEQUENCE_RECEPTOR_DEFAULT_TERMINAL_ONLY). Branch/terminal ids come from GET /partner/tenants/:id/sequences (or /config). Returns one cell per entry, in the order sent, with the counter as stored.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Partner app credential (ecp_*)
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" }]