Fac-360
Organizations

Read one client company, its capabilities, its certificate and its credentials

Everything needed to answer 'can this client bill, and if not why not'. THE THREE FAILURES ARE ONE ANSWER: a company belonging to another organization, a company that does not exist and an INACTIVE company all return the identical 404, decided by a single SELECT rather than by three branches, so this route cannot be used to discover that a RUC is registered elsewhere. Requires organizations:read; a credential holding companies:manage satisfies it, and one holding only organizations:read can create nothing, mint nothing and enrol nothing.

GET
/api/v2/organizations/companies/{id}

Everything needed to answer 'can this client bill, and if not why not'. THE THREE FAILURES ARE ONE ANSWER: a company belonging to another organization, a company that does not exist and an INACTIVE company all return the identical 404, decided by a single SELECT rather than by three branches, so this route cannot be used to discover that a RUC is registered elsewhere. Requires organizations:read; a credential holding companies:manage satisfies it, and one holding only organizations:read can create nothing, mint nothing and enrol nothing.

Authorization

bearerAuth
AuthorizationBearer <token>

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

Path Parameters

id*string
Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v2/organizations/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Authorization: Bearer apf_v2_tu_credencial"
{  "schemaVersion": "2.0",  "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",  "resourceId": "026d60bb-63a8-407e-bf67-01dcfc6022e6",  "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",  "company": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "ruc": "string",    "legalName": "string",    "status": "ACTIVE",    "environment": "BETA",    "createdAt": "2019-08-24T14:15:22Z",    "capabilities": [      {        "capability": "string",        "enabled": true      }    ],    "certificate": {      "readyToSign": true,      "active": {        "configurationId": "254ffdcc-3725-465c-b0a0-22afb2bec267",        "version": 1,        "status": "DRAFT",        "createdAt": "2019-08-24T14:15:22Z",        "activatedAt": "2019-08-24T14:15:22Z",        "retiredAt": "2019-08-24T14:15:22Z",        "serialNumber": "string",        "issuer": "string",        "subjectRuc": "string",        "notBefore": "2019-08-24T14:15:22Z",        "notAfter": "2019-08-24T14:15:22Z",        "revokedAt": "2019-08-24T14:15:22Z",        "activation": {          "activationId": "a606ed3b-704a-4227-aa5c-f71d4aee9a1f",          "status": "PENDING",          "responseCode": "string",          "responseMessage": "string",          "failureCode": "string",          "startedAt": "2019-08-24T14:15:22Z",          "finishedAt": "2019-08-24T14:15:22Z"        }      },      "latest": {        "configurationId": "254ffdcc-3725-465c-b0a0-22afb2bec267",        "version": 1,        "status": "DRAFT",        "createdAt": "2019-08-24T14:15:22Z",        "activatedAt": "2019-08-24T14:15:22Z",        "retiredAt": "2019-08-24T14:15:22Z",        "serialNumber": "string",        "issuer": "string",        "subjectRuc": "string",        "notBefore": "2019-08-24T14:15:22Z",        "notAfter": "2019-08-24T14:15:22Z",        "revokedAt": "2019-08-24T14:15:22Z",        "activation": {          "activationId": "a606ed3b-704a-4227-aa5c-f71d4aee9a1f",          "status": "PENDING",          "responseCode": "string",          "responseMessage": "string",          "failureCode": "string",          "startedAt": "2019-08-24T14:15:22Z",          "finishedAt": "2019-08-24T14:15:22Z"        }      }    },    "certificatePath": "string",    "credentialsPath": "string"  },  "credentials": [    {      "credentialId": "f568fec0-10b6-4b94-9daf-e62c50c9bf3e",      "name": "string",      "tokenPrefix": "string",      "tokenFormat": "V2_SHA256",      "scopes": [        "string"      ],      "status": "ACTIVE",      "createdAt": "2019-08-24T14:15:22Z",      "expiresAt": "2019-08-24T14:15:22Z",      "revokedAt": "2019-08-24T14:15:22Z",      "lastUsedAt": "2019-08-24T14:15:22Z"    }  ]}

Consolidated consumption across every company in the organization GET GET

A read, and only a read. ADR 0016 point 6 keeps the quota holder on the company: a platform with fifty clients has fifty subscriptions and each taxpayer pays its own. usage.consume_quota is untouched. Each company is reported against its own plan period, so a mixed portfolio of DAY and MONTH plans is not flattened onto a window this route picked.

Look a RUC up in the hosted SUNAT padrón — informational, never a validation GET GET

Answers what SUNAT's published padrón says about a RUC: the legal name, the literal estado del contribuyente and condición de domicilio, and a coarse classification of each. THIS DOES NOT VALIDATE ANYTHING AND DOES NOT AFFECT ISSUANCE. A RUC this route reports as not registered can still be invoiced, and doing so is neither an error nor a warning: no create, no trigger and no dispatch decision reads this catalogue. The copy is a snapshot and is therefore ALWAYS behind — a company registered since the snapshot was cut is absent from it while being entirely able to receive a comprobante — so treat the answer as information for a human, not as a gate. THERE ARE THREE OUTCOMES AND ONLY TWO OF THEM ARE ABOUT THE TAXPAYER: 200 with registered=true, 200 with registered=false (a snapshot is loaded and this RUC is not in it), and 503 TAXPAYER_REGISTRY_UNAVAILABLE (no snapshot is loaded at all, which is a statement about this service). A client that folds the 503 into registered=false reports an outage of ours as a fact about somebody's customer. Both the literal SUNAT value and the classification are returned: the literal is authoritative and the classification is ours and may be UNKNOWN, so a value SUNAT adds tomorrow is visible rather than silently mapped. registry.publishedOn dates the snapshot the answer came from and is SUNAT's own publication date, never the time this API ingested it. Requires consultations:read, which is disjoint from every documents:* capability: asking who a RUC belongs to must not require a credential that can issue a comprobante.