webhook y te entregamos el resultado en tu URL cuando está listo.
Cómo funciona
- Crea la petición. Haz
POSTcon la consulta y un objetowebhook. La API responde de inmediato contype: ACCEPTEDy untransactionId. Aceptar la petición no se cobra (billable: false). - Recibe el resultado. Cuando la consulta se resuelve, enviamos un
POSTHTTP a tuwebhook.url. El cuerpo es el envelope estándar, con el mismotransactionIddel paso 1.
INVALID_REQUEST de inmediato en lugar de ACCEPTED, y nunca se cobra:
El objeto webhook
Tu endpoint de webhook
- Recibe un
POSTHTTP con cuerpo JSON (Content-Type: application/json) y los headers que configuraste. - Responde con cualquier status
2xxen cuanto recibas el cuerpo, y procésalo después. - Hazlo idempotente: el mismo resultado puede llegar más de una vez, así que usa
transactionIdpara descartar duplicados.
Intentos de entrega
Intentamos entregar cada resultado hasta 3 veces: de inmediato, y luego 1 minuto y 5 minutos después del intento fallido anterior. Un intento falla cuando tu endpoint no responde con un status2xx en menos de 10 segundos (no seguimos redirecciones). Después del tercer intento fallido, el resultado ya no se vuelve a enviar.
La disponibilidad de tu endpoint de webhook es tu responsabilidad: los créditos se cobran cuando el resultado se resuelve, lo reciba o no tu endpoint. En Contribution Weeks todavía puedes consultar el resultado durante 24 horas (ver Respaldo de Contribution Weeks).
Cobro
Los créditos se cobran una sola vez, cuando el resultado se resuelve, con la misma regla que el resto de los endpoints (ver Créditos):billable: true cuando la consulta se realizó — aunque el resultado sea negativo, como CURP_NOT_FOUND — y false en fallas técnicas. El campo billable del cuerpo que recibe tu webhook indica cuál aplica.
Resultados por servicio
Cada endpoint asíncrono entrega a tu webhook uno de los siguientes resultados. Abre un tipo para ver su ejemplo completo.Get NSS (Async)
Mismos tipos de resultado que Get NSS, exceptoINVALID_REQUEST, que se responde de inmediato al crear la petición.
SUCCESS
NSS found
SUCCESS
NSS found
PERSON_WITHOUT_NSS
Person has no NSS assigned
PERSON_WITHOUT_NSS
Person has no NSS assigned
IMSS_INCONSISTENT_DATA
CURP exists but associated data is inconsistent at IMSS
IMSS_INCONSISTENT_DATA
CURP exists but associated data is inconsistent at IMSS
CURP_NOT_FOUND
CURP not found
CURP_NOT_FOUND
CURP not found
IMSS_OPERATION_LIMIT
IMSS daily limit reached
IMSS_OPERATION_LIMIT
IMSS daily limit reached
IMSS service is currently unavailable
IMSS service is currently unavailable
INTERNAL_ERROR
Unexpected internal error
INTERNAL_ERROR
Unexpected internal error
Employment Status (Async)
Mismos tipos de resultado ydata que Employment Status, excepto INVALID_REQUEST, que se responde de inmediato al crear la petición. MISMATCH_CURP_NSS solo ocurre si envías nss, y data.files[] solo se incluye con includePdf: true (el contenido del PDF está recortado en el ejemplo).
SUCCESS
Active employment found
SUCCESS
Active employment found
SUCCESS (includePdf: true)
Active employment found — with the official PDF in data.files[]
SUCCESS (includePdf: true)
Active employment found — with the official PDF in data.files[]
INACTIVE_EMPLOYMENT
No active employment found
INACTIVE_EMPLOYMENT
No active employment found
MISMATCH_CURP_NSS
CURP and NSS do not match
MISMATCH_CURP_NSS
CURP and NSS do not match
CURP_NOT_FOUND
CURP not found in IMSS
CURP_NOT_FOUND
CURP not found in IMSS
PERSON_WITHOUT_NSS
Person exists at IMSS but has no own NSS assigned
PERSON_WITHOUT_NSS
Person exists at IMSS but has no own NSS assigned
IMSS_INCONSISTENT_DATA
CURP exists but associated data is inconsistent at IMSS
IMSS_INCONSISTENT_DATA
CURP exists but associated data is inconsistent at IMSS
IMSS_OPERATION_LIMIT
IMSS daily limit reached
IMSS_OPERATION_LIMIT
IMSS daily limit reached
IMSS service is currently unavailable
IMSS service is currently unavailable
INTERNAL_ERROR
Unexpected internal error
INTERNAL_ERROR
Unexpected internal error
Contribution Weeks
Cómo leerdata (SUCCESS e INACTIVE_EMPLOYMENT):
- Campos oficiales, tomados del documento del IMSS:
nss,personalInfo,contributionWeeks(total=contributed−discounted+reinstated),employmentHistory(un renglón por empleo, del más reciente al más antiguo) yreportDetails(folio,issueDate,digitalSeal, …).files[0]es el PDF oficial en base64 (recortado en los ejemplos). - El empleo vigente es el renglón de
employmentHistoryconendDate: null; enINACTIVE_EMPLOYMENTno hay ninguno. - Todo lo calculado vive en
derivedSignals—currentStatus,jobTenure(meses),stability,salaryysalaryTimeline. Son hechos, no un score de crédito. - Los salarios (
baseSalary,*Salary) son el salario base de cotización (SBC) diario; el equivalente mensual es SBC × 30.44.salaryAtLegalCap: truesignifica que el salario llegó al tope legal (25 UMA), así que el ingreso real puede ser mayor. - Todos los campos siempre están presentes; los que no aplican vienen en
null.
SUCCESS
Active employment found
SUCCESS
Active employment found
INACTIVE_EMPLOYMENT
No active employment found
INACTIVE_EMPLOYMENT
No active employment found
CURP_NOT_FOUND
CURP not found in IMSS
CURP_NOT_FOUND
CURP not found in IMSS
PERSON_WITHOUT_NSS
Person has no NSS assigned
PERSON_WITHOUT_NSS
Person has no NSS assigned
IMSS_INCONSISTENT_DATA
CURP exists but associated data is inconsistent at IMSS
IMSS_INCONSISTENT_DATA
CURP exists but associated data is inconsistent at IMSS
IMSS_OPERATION_LIMIT
IMSS daily limit reached
IMSS_OPERATION_LIMIT
IMSS daily limit reached
IMSS service is currently unavailable
IMSS service is currently unavailable
INTERNAL_ERROR
Unexpected internal error
INTERNAL_ERROR
Unexpected internal error
IMSS could not generate the report for this record
IMSS could not generate the report for this record
IMSS_RECORD_ERROR
Unexpected IMSS error for this record
IMSS_RECORD_ERROR
Unexpected IMSS error for this record
IMSS_REPORT_UNAVAILABLE e IMSS_RECORD_ERROR son propios de ese registro mientras el servicio funciona; no se cobran y la misma CURP se puede enviar de nuevo otro día.
Respaldo de Contribution Weeks
Si tu webhook no pudo recibir un resultado de Contribution Weeks, consúltalo durante 24 horas con Contribution Weeks Result (gratis), enviando eltransactionId:
RESULT_FOUND (con el envelope original del resultado dentro de data), RESULT_PENDING o RESULT_EXPIRED. Úsalo solo como respaldo: el resultado siempre se envía a tu webhook.