Fac-360
Companies

Open a period, which sends nothing to SUNAT

ADMIN and above. Opening a period is a row in our ledger saying somebody intends to work on this month; nothing leaves for SUNAT and nothing is committed. A company still issuing in BETA is refused by the database, by the trigger migration 000080 installs, and this route only translates that refusal. Keeping the check in the database means the second entry point cannot forget it.

POST
/console/v1/companies/{companyId}/sire/periods/{book}/{period}

ADMIN and above. Opening a period is a row in our ledger saying somebody intends to work on this month; nothing leaves for SUNAT and nothing is committed.

A company still issuing in BETA is refused by the database, by the trigger migration 000080 installs, and this route only translates that refusal. Keeping the check in the database means the second entry point cannot forget it.

Authorization

consoleSession
__Host-apf_console<token>

Set by POST /console/v1/sessions. HttpOnly, Secure, SameSite=Strict, Path=/, __Host- prefixed. It is never readable by JavaScript and there is no header alternative: accepting both carriers would let an attacker choose the weaker one.

In: cookie

Path Parameters

companyId*string
Formatuuid
book*string

Value in

  • "rvie"
  • "rce"
period*string
Match^[0-9]{4}(0[1-9]|1[0-2])$

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/console/v1/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/sire/periods/rvie/string" \  -H "Authorization: Bearer apf_v2_tu_credencial"
{  "schemaVersion": "console.1",  "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",  "book": "rvie",  "period": "string",  "status": "string",  "ticket": "string",  "sunat": {    "code": "string",    "message": "string"  },  "updatedAt": "2019-08-24T14:15:22Z"}