Open a period in the ledger, or return the one already open
Records that somebody intends to work on this month. IT SENDS NOTHING TO SUNAT, which is why it needs only sire:read — requiring sire:manage would make looking impossible without also holding the capability to close a period. Idempotent by the schema: one operation per (company, book, period), so a repeat returns the one that exists rather than starting a second. Reopening never resets a period that is already awaiting a ticket. A COMPANY IN BETA IS REFUSED with 409 SIRE_REQUIRES_PRODUCTION. SIRE only knows real RUCs and has no test environment: it is not that a beta company would fail, it is that there is nowhere for it to try. The refusal comes from the database, not from this route.
Records that somebody intends to work on this month. IT SENDS NOTHING TO SUNAT, which is why it needs only sire:read — requiring sire:manage would make looking impossible without also holding the capability to close a period. Idempotent by the schema: one operation per (company, book, period), so a repeat returns the one that exists rather than starting a second. Reopening never resets a period that is already awaiting a ticket.
A COMPANY IN BETA IS REFUSED with 409 SIRE_REQUIRES_PRODUCTION. SIRE only knows real RUCs and has no test environment: it is not that a beta company would fail, it is that there is nowhere for it to try. The refusal comes from the database, not from this route.
Authorization
bearerAuth Tenant-bound, scoped and expiring Apifact credential. Migrated legacy credentials are accepted only on deprecated v1 writes and tenant-scoped v2 read, poll and download routes. Each operation names the single scope it requires in x-required-scope; the scope array of the security requirement itself is empty because OpenAPI 3.0 requires it to be for a non-oauth2 scheme.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v2/sire/periods" \ -H "Authorization: Bearer apf_v2_tu_credencial" \ -H "Content-Type: application/json" \ -d '{ "book": "rvie", "period": "202412" }'{ "schemaVersion": "2.0", "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6", "book": "rvie", "period": "string", "status": "PENDING", "ticket": "string", "sunat": { "code": "string", "message": "string" }, "updatedAt": "2019-08-24T14:15:22Z", "history": [ { "status": "string", "detail": "string", "at": "2019-08-24T14:15:22Z" } ]}List this company's SIRE periods GET GET
Every period this company has opened, in either book, newest movement first. Reading is always available even on a deployment that cannot RUN a period: a caller has to be able to find out what state a period is in.
Read one period and everything that happened to it GET GET
The poll target the 202 names, and the place an operator answers 'how did this period get here'. history carries every transition with SUNAT's own code and message where there was one, because a responseCode is what tells somebody what to do and 'it failed' is not.