Skip to main content

Endpoint

Generates an Excel file containing employee data formatted for SCTR (Seguro Complementario de Trabajo de Riesgo) insurance submission. The response is a downloadable Excel file with standardized columns required by the insurance provider.

Request

Headers

{
  "Content-Type": "application/json"
}

Body Parameters

body
array
required
Array of employee objects to include in the Excel file

Response

Returns an Excel file (.xlsx) with the following headers:
ColumnDescriptionFormat
ItemSequential numberNumber
Apellido PaternoFather’s last nameText
Apellido MaternoMother’s last nameText
NombresFirst nameText
SexoGenderM/F
Fecha Nac.Birth dateExcel serial date
NacionalidadNationalityAlways “PERUANA”
Tipo Doc.Document typeAlways “DNI”
Numero Doc.Document numberText
DCVerification digitEmpty (to be filled)
CondiciónEmployee conditionAlways “P” (Permanent)
CargoPositionText
Moneda SueldoCurrencyAlways “SOLES”
SueldoSalaryFormatted currency
TasaRisk rateAlways “ALTO RIESGO”
Fecha IngresoEntry dateExcel serial date
Fecha ceseEnd dateExcel serial date
Cod/ClienteClient codeEmpty (to be filled)
SedeHeadquartersAlways “PLAYA”

Response Headers

Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content-Disposition: attachment; filename=FORMATO_SCTR.xlsx
Content-Length: [file size in bytes]

Example

curl -X POST https://api.kontrak.com/api/excel/download-sctr \
  -H "Content-Type: application/json" \
  -d '[
    {
      "name": "Juan",
      "lastNameFather": "Pérez",
      "lastNameMother": "García",
      "dni": "12345678",
      "position": "Operario",
      "salary": 1500,
      "sex": "M",
      "entryDate": "01/03/2024",
      "birthDate": "15/06/1990",
      "endDate": "31/12/2024"
    },
    {
      "name": "María",
      "lastNameFather": "López",
      "lastNameMother": "Martínez",
      "dni": "87654321",
      "position": "Supervisor",
      "salary": 2500,
      "sex": "F",
      "entryDate": "15/02/2024",
      "birthDate": "22/08/1988",
      "endDate": "31/12/2024"
    }
  ]' \
  --output FORMATO_SCTR.xlsx

Error Responses

Empty Request Body

{
  "success": false,
  "message": "No se recibieron datos. Debes enviar una lista de empleados."
}

Too Many Employees

{
  "success": false,
  "message": "Máximo 80 empleados por lote"
}

Validation Error

{
  "success": false,
  "message": "Validation error",
  "errors": [
    {
      "field": "sex",
      "message": "El genero es requerido."
    },
    {
      "field": "dni",
      "message": "DNI debe tener exactamente 8 dígitos numéricos."
    }
  ]
}

Notes

  • The generated file includes centered headers in the first row
  • Dates are converted to Excel serial date format for compatibility
  • Nationality is always set to “PERUANA”
  • Document type is always set to “DNI”
  • Currency is always set to “SOLES”
  • Condition is always set to “P” (Permanent)
  • Risk rate is always set to “ALTO RIESGO” (High Risk)
  • Headquarters is always set to “PLAYA”
  • DC (verification digit) field is left empty for manual completion
  • Client code field is left empty for manual completion
  • Salary is formatted with currency symbols (S/.)
  • Minimum 1 employee required, maximum 50 employees per batch
  • File name is always FORMATO_SCTR.xlsx

Build docs developers (and LLMs) love