Skip to content

Get tenant credentials info (both environments)

GET
/v1/tenants/{tenantId}/credentials
curl --request GET \
--url https://api.emite.cr/v1/tenants/example/credentials \
--header 'Authorization: Bearer <token>'

Returns the public metadata for the sandbox and production credentials (cert subject, notBefore/notAfter, ATV username/clientId/hasClientSecret) plus the activeEnvironment flag; an environment without credentials is null. Sensitive fields (.p12 binary, PIN, ATV password, client secret) are NEVER returned. atvRejectedAt is set while Hacienda refuses the stored ATV user and password: documents keep their number and wait signed (waitingDocuments), and go to Hacienda on their own once the credentials are saved again or POST …/verify succeeds.

tenantId
required
string

UUID of the caller's own company.

Media typeapplication/json
object
activeEnvironment
required

The company's active environment: where documents created from a member's session are issued, and whose credentials they use. Changed with PATCH …/credentials/active-environment.

string
Allowed values: sandbox production
sandbox
required

The sandbox credentials; null when none are uploaded.

object
environment
required

The environment these credentials belong to.

string
Allowed values: sandbox production
atvUsername
required

The ATV user stored for this environment. Its password is never returned.

string
atvClientId
required

Client id of Hacienda's IdP the credentials are presented to: api-stag for sandbox, api-prod for production.

string
hasClientSecret
required

Whether a non-empty IdP client secret is stored. The secret itself is never returned.

boolean
certSubjectCn
required

Common name (CN) of the subject of the stored .p12 certificate. null when the stored certificate could not be read.

string
nullable
certNotBefore
required

Start of the certificate validity. null when the stored certificate could not be read.

string format: date-time
nullable
certNotAfter
required

End of the certificate validity — upload a new certificate before then. null when the stored certificate could not be read.

string format: date-time
nullable
uploadedAt
required

When credentials were uploaded for this environment. Replacing or updating them keeps this date and moves updatedAt.

string format: date-time
updatedAt
required

When these credentials were last saved: uploaded, replaced or updated.

string format: date-time
atvRejectedAt
required

Since when Hacienda's IdP refuses the stored ATV user and password; null while they work (or nothing is known against them). While set, documents are not sent with them: they keep their number and wait signed (waitingDocuments), and go to Hacienda on their own once the credentials are saved again or POST …/verify answers restored.

string format: date-time
nullable
atvRejectionDetail
required

The refusal in the words of Hacienda's IdP; null while nothing is known against the credentials.

string
nullable
waitingDocuments
required

How many numbered, signed documents of this environment wait for these credentials to reach Hacienda. 0 while they work.

number
production
required

The production credentials; null when none are uploaded.

object
environment
required

The environment these credentials belong to.

string
Allowed values: sandbox production
atvUsername
required

The ATV user stored for this environment. Its password is never returned.

string
atvClientId
required

Client id of Hacienda's IdP the credentials are presented to: api-stag for sandbox, api-prod for production.

string
hasClientSecret
required

Whether a non-empty IdP client secret is stored. The secret itself is never returned.

boolean
certSubjectCn
required

Common name (CN) of the subject of the stored .p12 certificate. null when the stored certificate could not be read.

string
nullable
certNotBefore
required

Start of the certificate validity. null when the stored certificate could not be read.

string format: date-time
nullable
certNotAfter
required

End of the certificate validity — upload a new certificate before then. null when the stored certificate could not be read.

string format: date-time
nullable
uploadedAt
required

When credentials were uploaded for this environment. Replacing or updating them keeps this date and moves updatedAt.

string format: date-time
updatedAt
required

When these credentials were last saved: uploaded, replaced or updated.

string format: date-time
atvRejectedAt
required

Since when Hacienda's IdP refuses the stored ATV user and password; null while they work (or nothing is known against them). While set, documents are not sent with them: they keep their number and wait signed (waitingDocuments), and go to Hacienda on their own once the credentials are saved again or POST …/verify answers restored.

string format: date-time
nullable
atvRejectionDetail
required

The refusal in the words of Hacienda's IdP; null while nothing is known against the credentials.

string
nullable
waitingDocuments
required

How many numbered, signed documents of this environment wait for these credentials to reach Hacienda. 0 while they work.

number
Example
{
"activeEnvironment": "sandbox",
"sandbox": {
"environment": "sandbox",
"atvUsername": "cpf-12-3456-789012@stag.comprobanteselectronicos.go.cr",
"atvClientId": "api-stag",
"certSubjectCn": "EMPRESA EJEMPLO SOCIEDAD ANONIMA",
"atvRejectionDetail": "invalid_grant: Invalid user credentials",
"waitingDocuments": 0
},
"production": {
"environment": "sandbox",
"atvUsername": "cpf-12-3456-789012@stag.comprobanteselectronicos.go.cr",
"atvClientId": "api-stag",
"certSubjectCn": "EMPRESA EJEMPLO SOCIEDAD ANONIMA",
"atvRejectionDetail": "invalid_grant: Invalid user credentials",
"waitingDocuments": 0
}
}

Missing or invalid JWT / API key

:tenantId is not the caller's company, or insufficient scope — credentials:* is never granted to an API key.