Retrieve the certificate (PFX) — first time only
const url = 'https://dev-api.tsp.cl/firma_digital/dev/api/partners/v1/certificate_claim';const options = { method: 'POST', headers: {'x-gw': '<x-gw>', 'Content-Type': 'application/json'}, body: '{"p_code":"example","dni":"18925910-7","pin":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dev-api.tsp.cl/firma_digital/dev/api/partners/v1/certificate_claim \ --header 'Content-Type: application/json' \ --header 'x-gw: <x-gw>' \ --data '{ "p_code": "example", "dni": "18925910-7", "pin": "example" }'Generates and delivers the certificate for a purchase code that already went through certificate_request (B2C flow). It is one-time only: if the certificate was already claimed, it responds 201 without regenerating it. Does not apply to B2B partners, who receive the certificate automatically during certificate_request.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
18925910-7The same PIN sent in certificate_request.
Responses
Section titled “ Responses ”Certificate issued and delivered.
object
object
Base64-encoded PFX.
Example
{ "success": true}The certificate was already claimed before — not regenerated. error: "ALREADY_ISSUED".
A validation is currently in progress for this purchase code — retry in a few seconds.
Invalid or missing API Key.
The purchase code does not exist, or exists but hasn’t gone through certificate_request yet (identity not validated).
RUT/PIN do not match what was set during certificate_request.