Certificates
Upload and manage PKCS#12 signing certificates for fiscal authority communication. All endpoints require authentication.
Upload a certificate
POST /v1/certificates
Uploads a PKCS#12 certificate bundle. The certificate is validated, and metadata (subject, issuer, validity dates, NIF) is extracted automatically.
Request
Multipart form data:
| Field | Type | Required | Description |
|---|---|---|---|
certificate | file | Yes | PKCS#12 (.p12/.pfx) file, max 10 MB |
password | string | Yes | Password to decrypt the PKCS#12 bundle |
certificate_id | string | Yes | Identifier for referencing in location config (alphanumeric, hyphens, underscores, dots) |
Example
curl -X POST https://api.fiscalapi.com/v1/certificates \
-H "Authorization: Bearer fsk_test_abc123def456..." \
-F "certificate=@signing-cert.p12" \
-F "password=my-cert-password" \
-F "certificate_id=spain-prod-2026"
Response 201 Created
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"certificate_id": "spain-prod-2026",
"subject_cn": "ACME CORP SL",
"issuer": "AC FNMT Usuarios",
"not_before": "2025-01-15T00:00:00Z",
"not_after": "2027-01-15T23:59:59Z",
"nif": "B12345674",
"created_at": "2026-03-09T12:00:00Z"
}
Errors
| Status | Error | Cause |
|---|---|---|
400 | certificate_id is required | Missing certificate_id field |
400 | invalid certificate_id format | Contains invalid characters |
400 | password is required | Missing password field |
400 | failed to read certificate file | File upload error |
400 | failed to decode PKCS#12 bundle | Invalid file or wrong password |
409 | certificate with this ID already exists | Duplicate certificate_id |
List certificates
GET /v1/certificates
Returns all certificates for the authenticated account.
Example
curl https://api.fiscalapi.com/v1/certificates \
-H "Authorization: Bearer fsk_test_abc123def456..."
Response 200 OK
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"certificate_id": "spain-prod-2026",
"subject_cn": "ACME CORP SL",
"issuer": "AC FNMT Usuarios",
"not_before": "2025-01-15T00:00:00Z",
"not_after": "2027-01-15T23:59:59Z",
"nif": "B12345674",
"created_at": "2026-03-09T12:00:00Z"
}
]
}
Delete a certificate
DELETE /v1/certificates/{id}
Deletes a certificate by its certificate_id.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The certificate_id assigned during upload |
Example
curl -X DELETE https://api.fiscalapi.com/v1/certificates/spain-prod-2026 \
-H "Authorization: Bearer fsk_test_abc123def456..."
Response 204 No Content
No response body.
Errors
| Status | Error |
|---|---|
404 | certificate not found |