> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clevis.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Peru

> Peruvian payroll scheme: ordinario (Regimen General D.Leg. 728)

## Available schemes

| Scheme      | Description                                                         | Years      |
| ----------- | ------------------------------------------------------------------- | ---------- |
| `ordinario` | Planilla de remuneraciones: EsSalud + ONP/AFP + Renta 5ta Categoria | 2025, 2026 |

## Ordinario

The `ordinario` scheme covers employees under Peruvian private labor law (Regimen General, D.Leg. 728 / TUO D.S. 003-97-TR). Includes health insurance (EsSalud), pension contributions (ONP or AFP), and income tax withholding (Renta de 5ta Categoria).

### What it calculates

**Employee deductions (descuentos):**

* **ONP** — National pension system contribution (13%), or
* **AFP** — Private pension system combined rate (\~12.82%): 10% fund + \~1.35% disability/survival insurance + \~1.47% flow commission
* **Renta 5ta Categoria** — Monthly income tax withholding (projected annual method)

**Employer contributions:**

* **EsSalud** — Health insurance (9% of insurable remuneration, minimum base 1 RMV)

**Perceptions included:**

* **Remuneracion basica** — Base monthly salary
* **Asignacion familiar** — Family allowance: 10% of RMV (Ley 25129, via flag)
* **Horas extras** — Overtime (pre-calculated by client with 25%/35% surcharge)
* **Gratificacion legal** — Legal bonus: equivalent to 1 monthly salary (July and December, via flag)
* **Bonificacion extraordinaria** — 9% of gratificacion, paid to employee in lieu of EsSalud (Ley 29351, auto-calculated when gratificacion applies)

### Employee inputs

| Field                                  | Type    | Required | Default | Description                                                 |
| -------------------------------------- | ------- | -------- | ------- | ----------------------------------------------------------- |
| `monthly_salary`                       | number  | Yes      | —       | Remuneracion basica mensual (PEN)                           |
| `daily_salary`                         | number  | Yes      | —       | Salario diario (monthly / 30)                               |
| `overtime_amount`                      | number  | No       | 0       | Pre-calculated overtime already including 25%/35% surcharge |
| `overrides.regimen_onp`                | boolean | No       | false   | Set `true` for SNP (ONP) affiliates                         |
| `overrides.regimen_afp`                | boolean | No       | false   | Set `true` for SPP (AFP) affiliates                         |
| `overrides.aplica_asignacion_familiar` | boolean | No       | false   | Set `true` for workers with minor or student dependents     |
| `overrides.paga_gratificacion`         | boolean | No       | false   | Set `true` only in July and December                        |

> `regimen_onp` and `regimen_afp` are mutually exclusive — set exactly one to `true`.

### Pension system: ONP vs AFP

Peru has two pension systems. The client must indicate which one applies per employee:

| System                              | Flag                | Rate            | Base                                      |
| ----------------------------------- | ------------------- | --------------- | ----------------------------------------- |
| ONP (Sistema Nacional de Pensiones) | `regimen_onp: true` | 13%             | Remuneracion asegurable                   |
| AFP (Sistema Privado de Pensiones)  | `regimen_afp: true` | 12.82% combined | Base AFP mensual (includes gratificacion) |

The AFP rate of 12.82% is an industry average for 2025–2026. Individual AFP rates vary slightly (Prima, Integra, Habitat, Profuturo differ by less than 0.15%).

### Gratificaciones and EsSalud exemption

Gratificaciones (July/December) are **exempt from EsSalud and ONP** under Ley 30334. Instead, the employer must pay the employee a **bonificacion extraordinaria of 9%** of the gratificacion (Ley 29351) — this is automatically calculated when `paga_gratificacion = true`.

Gratificaciones **are subject to IR 5ta Categoria**.

### Renta 5ta Categoria — projection method

The engine uses a simplified annual projection (not the exact SUNAT year-to-date method):

renta\_anual\_proyectada = (remuneracion\_basica + asignacion\_familiar) × 14.18
base\_gravable\_anual    = max(renta\_anual\_proyectada − 7 × UIT, 0)
impuesto\_anual         = apply\_bracket(base\_gravable\_anual, escala\_5ta)
retencion\_mensual      = impuesto\_anual / 12

The factor **14.18** represents: 12 months + 2 gratificaciones × (1 + 0.09 bonificacion extraordinaria) = 12 + 2 × 1.09 = 14.18.

Overtime for the current month is **not annualized** (treated as one-time). For payrolls with frequent overtime, the client should account for this externally.

### Key reference values

| Value                | 2025                                    | 2026      |
| -------------------- | --------------------------------------- | --------- |
| UIT                  | S/ 5,350                                | S/ 5,500  |
| Deduccion 7 UIT      | S/ 37,450                               | S/ 38,500 |
| RMV                  | S/ 1,025 (Jan–Apr) / S/ 1,130 (May–Dec) | S/ 1,130  |
| Asignacion familiar  | S/ 102.50 / S/ 113.00                   | S/ 113.00 |
| EsSalud minimum base | 1 RMV                                   | 1 RMV     |

**2025 RMV note:** Two values apply — S/1,025 until April 30 (D.S. 004-2022-TR) and S/1,130 from May 1 (D.S. 005-2025-TR).

### IR 5ta Categoria brackets

The scale is permanent in UIT terms (TUO Ley IR Art. 53). The PEN amounts change each year as the UIT is updated.

**2025** (UIT = S/ 5,350):

| From (PEN) | To (PEN) | UIT range   | Rate |
| ---------- | -------- | ----------- | ---- |
| 0          | 26,750   | 0 – 5 UIT   | 8%   |
| 26,750     | 107,000  | 5 – 20 UIT  | 14%  |
| 107,000    | 187,250  | 20 – 35 UIT | 17%  |
| 187,250    | 240,750  | 35 – 45 UIT | 20%  |
| 240,750    | —        | > 45 UIT    | 30%  |

**2026** (UIT = S/ 5,500):

| From (PEN) | To (PEN) | UIT range   | Rate |
| ---------- | -------- | ----------- | ---- |
| 0          | 27,500   | 0 – 5 UIT   | 8%   |
| 27,500     | 110,000  | 5 – 20 UIT  | 14%  |
| 110,000    | 192,500  | 20 – 35 UIT | 17%  |
| 192,500    | 247,500  | 35 – 45 UIT | 20%  |
| 247,500    | —        | > 45 UIT    | 30%  |

### What is not included in v1

| Item                         | Reason                                                                             |
| ---------------------------- | ---------------------------------------------------------------------------------- |
| SCTR (occupational accident) | Variable by employer risk class — requires employer-level inputs not yet supported |
| SENATI (0.75%)               | Only applies to industrial employers with 20+ workers                              |
| YTD withholding adjustment   | Requires year-to-date history; SUNAT strict method deferred to future version      |
| Per-AFP exact rates          | AFP rates vary \<0.15%; 12.82% industry average used                               |

### Example request

```bash theme={null}
curl -X POST https://api.clevis.dev/v1/payroll/calculate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "country": "PE",
    "scheme": "ordinario",
    "year": 2026,
    "period": {
      "type": "monthly",
      "start_date": "2026-03-01",
      "end_date": "2026-03-31",
      "days": 30
    },
    "employee": {
      "id": "emp_001",
      "daily_salary": 150,
      "monthly_salary": 4500,
      "overrides": {
        "regimen_afp": true,
        "regimen_onp": false,
        "aplica_asignacion_familiar": true,
        "paga_gratificacion": false
      }
    },
    "employer": { "id": "employer_001" }
  }'
```
