> ## 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.

# Introduction

> Embedded payroll calculation API for Latin America

Clevis Payroll API is a stateless computation engine for Latin American payroll.
Send employee data, receive an itemized breakdown with a step-by-step audit trail.

## What you can do

* **Calculate payroll** for a single employee or a batch — full perceptions, deductions, employer contributions, and audit trail
* **Simulate** salary scenarios without persisting results — for quote/preview UIs and compensation planning
* **Pay an employee their net salary** through a stable [Payouts API](/payouts/quickstart) (easy to test in sandbox, no real funds moved)

## Get started

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Calculate your first payroll in 5 minutes.
  </Card>

  <Card title="Pay a payroll" icon="money-bill-transfer" href="/payouts/quickstart">
    Calculate net salary, then pay it out end to end.
  </Card>

  <Card title="Authentication" icon="lock" href="/authentication">
    Set up your API key.
  </Card>

  <Card title="API Reference" icon="square-terminal" href="/api-reference">
    Explore all endpoints.
  </Card>

  <Card title="Error Handling" icon="triangle-exclamation" href="/guides/error-handling">
    Handle errors gracefully.
  </Card>
</CardGroup>

## Supported countries

| Country   | Schemes                   | Status             |
| --------- | ------------------------- | ------------------ |
| Mexico    | `ordinario`, `asimilados` | Active (2024-2026) |
| Colombia  | `ordinario`, `integral`   | Active (2025-2026) |
| Argentina | `ordinario`               | Active (2025-2026) |
| Brazil    | `empregado`               | Active (2025-2026) |
| Chile     | `ordinario`               | Active (2025-2026) |
| Peru      | `ordinario`               | Active (2025-2026) |

## Key concepts

* **Scheme** — A country-specific payroll ruleset (e.g., Mexico `ordinario`, Colombia `integral`).
  Use `GET /v1/payroll/schemes/{country}` to discover available schemes.
* **Calculation** — A single employee payroll run for one period.
* **Audit trail** — A step-by-step trace of every formula evaluated. Required for
  legal compliance in most Latin American countries.
* **Decimal precision** — All monetary amounts are returned as **JSON strings** (not numbers) to prevent
  floating-point precision loss. Parse them with your language's `Decimal` type before doing arithmetic.

## Base URL

```
https://api.clevis.dev/v1
```

## How it works

<Steps>
  <Step title="Send employee data">
    POST to `/v1/payroll/calculate` with salary, period, and country/scheme.
  </Step>

  <Step title="Engine computes">
    The engine resolves brackets, deductions, contributions, and exemptions
    using country-specific tax rules.
  </Step>

  <Step title="Get results">
    Receive itemized perceptions, deductions, employer costs, and a full
    audit trail. All monetary values as strings for precision.
  </Step>

  <Step title="Pay the net salary">
    POST to `/v1/payouts` with the `net_salary` from the previous step to
    pay the employee.
  </Step>
</Steps>
