Create an SII key

Stores a new SII credential for the caller. Cardda encrypts password and
certificate_password at rest; this is the only entry point that accepts them
in clear text. On creation Cardda runs a synchronous company sync against the
SII — on success the key flips to approved and its managed companies are
resolved; if the SII rejects the credentials the key ends up declined.

Company users must set user_id to their own Firebase uid, otherwise the
request is rejected with 401.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

SII credentials to store (encrypted at rest).

string
required

Tax id (RUT) the SII certificate belongs to. Digits plus verifier digit,
no dots (e.g. 761234567 or 12345678K). Must be unique across all SII
keys; a duplicate is rejected with 422.

string
required

SII portal password for the RUT. Stored encrypted at rest and never
returned by any read endpoint.

string

Password of the digital certificate (.pfx/.p12) used to sign electronic
documents. Optional at creation, but required before the key can issue
(can_issue?). Stored encrypted; never returned by read endpoints.

string
required

Firebase user id that owns the credential. Required. Create authorization
runs before the record is saved and only passes when user_id matches the
caller (or the caller is Cardda staff). A company user who omits user_id (or
sets it to another user) is therefore rejected with 401 before any validation
runs. For a Cardda staff caller, authorization passes and a missing user_id
then fails the mandatory user association with
{ "message": "Validation failed: User must exist" } (422).

Headers
uuid
required

UUID of the company on whose behalf the request is made. Fiscal-invoice endpoints
authorize the caller against this company (and read/write its data). SII-key
endpoints never filter their results by this header. On the SII-key list,
however, belonging to the header company is one of the ways a caller is authorized
to make the call (alongside being Cardda staff or passing their own user_id), so
the header is not merely ignored there. On the other SII-key endpoints the header
plays no part in authorization. See The company-id header
for details on how to obtain a value for this header and the error responses to
expect when it is missing or invalid.

Responses

401

Unauthorized — missing/invalid token, or a non-staff caller tried to create a
key for a different (or missing) user_id. Authorization runs before the save
and is by ownership (user_id must match the caller, unless the caller is
Cardda staff); the company-id header plays no part in create authorization.
Empty body.

422

Unprocessable entity — validation failed
({ "message": "Validation failed: ..." }), e.g. missing/blank password,
missing/invalid rut, or a RUT that already has an SII key (the rut unique
index). A missing user_id reaches this validation
({ "message": "Validation failed: User must exist" }) only for Cardda
staff callers; a company user who omits user_id is rejected earlier with
401 (see above), because authorization runs before the save.

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json