-
Signing certificate.
PUT /v1/tenant/certificate/{stage}with{"p12_base64": "<the .p12 in base64>", "password": "<its password>"}. A test key writestestand, write-only,production; a sandbox key writes nothing (403 stage_not_allowed). The bundle is opened in memory and stored as the stage’scert_pemandcert_key; neither the file nor its password is kept or returned. The answer is the certificate’s public metadata (subject,identifier, serial number, validity, fingerprint).nit_mismatch: trueis a warning: the subject does not carry the issuer’s NIT, as with a legal representative’s certificate. A bundle that cannot sign (wrong password, not PKCS#12, expired or not valid yet, a key that does not match, a key usage without digital signature and non-repudiation, a Cufea sandbox certificate, excessive key derivation iterations) answers422 certificate_invalidnaming the problem; a body over 96 KB answers413 payload_too_largebefore it is read.GET /v1/tenant/certificate/{stage}reads the key’s own stage only. -
Test set. Send the documents of the DIAN set from the test stage and follow them with
GET /v1/tenant/test-set:status:not_configured(no issuer or TestSetId),not_started(no test-stage document),in_progress, oraccepted(the DIAN accepted the current TestSetId, withaccepted_at).documents: test-stage invoices, credit and debit notes counted by their latest DIAN outcome (accepted,rejected,pending,failed).last_dian_answer: the latest DIAN status recorded on any of them, with itsstatus_code,status_descriptionand rule messages.
rejectedstatus: Cufea recognises the DIAN’s acceptance only, so a failed set staysin_progress; read the rejected counts andlast_dian_answer. The counts are those of the test stage, not of one TestSetId: after the issuer gets a new TestSetId they still include the earlier set’s documents (the acceptance itself follows the TestSetId). The DIAN sets how many documents a set needs; Cufea reports no required counts. -
Production preconditions. Register the production software id in
PUT /v1/tenant/issuer(production_software_id), add a production range and the production secrets with?environment=production(numbering range,software_pin,technical_key, and the production certificate of step 1).GET /v1/tenant/promotionlists what is still missing, one message per item;?copy_from_test=truecounts what the test stage would fill. -
Promotion.
POST /v1/tenant/promote(test key only) opens the production stage, or answers422 promotion_refusedwithmissing. With{"copy_from_test": true}the software id, PIN, certificate and key production lacks are copied from the test stage in the promotion’s own transaction (never the technical key, which belongs to the production range). A second call answers200unchanged. The database re-checks every precondition, including that no other tenant is in production with the same NIT. The promotion issues no production key; the first one is the operator’s.
From test to production
Certificate, DIAN test set and promotion to production with the API.
A tenant reaches the DIAN production stage with its own test key, the same steps the console
offers its owner. A reseller provisioning its clients uses each client’s test key.