curl --request PUT \
--url https://api.cufea.com/v1/tenant/certificate/{stage} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"p12_base64": "<string>",
"password": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({p12_base64: '<string>', password: '<string>'})
};
fetch('https://api.cufea.com/v1/tenant/certificate/{stage}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.cufea.com/v1/tenant/certificate/{stage}"
payload = {
"p12_base64": "<string>",
"password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"fingerprint_sha256": "<string>",
"identifier": "<string>",
"nit_mismatch": true,
"not_after": "2023-11-07T05:31:56Z",
"not_before": "2023-11-07T05:31:56Z",
"serial_number": "<string>",
"stage": "test",
"subject": "<string>"
}{
"code": "unauthorized",
"detail": "Missing or invalid API key.",
"request_id": "3668a7374b1e4314b2f932a5620da1f1",
"status": 401,
"title": "Unauthorized",
"type": "urn:cufea:problem:unauthorized"
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "validation_error",
"detail": "The request is not valid; see `errors` for the offending fields.",
"errors": [
{
"loc": [
"body",
"customer"
],
"msg": "Field required"
},
{
"loc": [
"body",
"lines"
],
"msg": "List should have at least 1 item after validation, not 0"
}
],
"request_id": "88272d6eb903438690d3193e3113270a",
"status": 422,
"title": "Request validation failed",
"type": "urn:cufea:problem:validation_error"
}{
"code": "rate_limited",
"detail": "This API key made more than 120 requests in the current window. Retry after 17 seconds.",
"request_id": "5d1c0b6f2e8a4f0c9a7b3e2d1c0f9a8b",
"status": 429,
"title": "Too Many Requests",
"type": "urn:cufea:problem:rate_limited"
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}Upload the signing certificate (.p12)
Stores a PKCS#12 bundle (.p12/.pfx, base64 in p12_base64) as the signing material of test or production, as the console’s certificate page does: the bundle is opened in memory with password, checked (an RSA key that matches the certificate, valid now, digital-signature usage, not a Cufea sandbox certificate) and stored encrypted as the stage’s cert_pem and cert_key. The bundle and its password are never stored or returned. A test key writes test and production (write-only, to prepare the promotion); a production key writes production; a sandbox key writes nothing. The answer is the certificate’s public metadata; nit_mismatch is a warning, not an error. The body is read with a cap of 96 KB (413).
curl --request PUT \
--url https://api.cufea.com/v1/tenant/certificate/{stage} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"p12_base64": "<string>",
"password": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({p12_base64: '<string>', password: '<string>'})
};
fetch('https://api.cufea.com/v1/tenant/certificate/{stage}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.cufea.com/v1/tenant/certificate/{stage}"
payload = {
"p12_base64": "<string>",
"password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"fingerprint_sha256": "<string>",
"identifier": "<string>",
"nit_mismatch": true,
"not_after": "2023-11-07T05:31:56Z",
"not_before": "2023-11-07T05:31:56Z",
"serial_number": "<string>",
"stage": "test",
"subject": "<string>"
}{
"code": "unauthorized",
"detail": "Missing or invalid API key.",
"request_id": "3668a7374b1e4314b2f932a5620da1f1",
"status": 401,
"title": "Unauthorized",
"type": "urn:cufea:problem:unauthorized"
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "validation_error",
"detail": "The request is not valid; see `errors` for the offending fields.",
"errors": [
{
"loc": [
"body",
"customer"
],
"msg": "Field required"
},
{
"loc": [
"body",
"lines"
],
"msg": "List should have at least 1 item after validation, not 0"
}
],
"request_id": "88272d6eb903438690d3193e3113270a",
"status": 422,
"title": "Request validation failed",
"type": "urn:cufea:problem:validation_error"
}{
"code": "rate_limited",
"detail": "This API key made more than 120 requests in the current window. Retry after 17 seconds.",
"request_id": "5d1c0b6f2e8a4f0c9a7b3e2d1c0f9a8b",
"status": 429,
"title": "Too Many Requests",
"type": "urn:cufea:problem:rate_limited"
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}Autorizaciones
Parámetros de ruta
Cuerpo
A PKCS#12 (.p12/.pfx) bundle and its password. Neither is stored or returned.
Respuesta
Successful Response
Public metadata of a stored signing certificate: never key or certificate material.