# Net to gross

`POST https://api.fiscalisto.com/v1/payroll/net_to_gross`

The daily salary and the SDI whose ordinary receipt for a full period pays the net you ask for, with today's ISR and IMSS, like «Calcular desde el neto» on each employee in the app. With employee it takes their pay frequency and benefits; without it, those you send or the legal ones. Without absences, incidents or deductions like Infonavit or loans. It saves nothing: to use it, update the employee.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | header |  | Optional (the SDKs send it on their own). If the response is lost, repeat the request with the same value within 24 hours: it answers the same, with idempotent-replayed: true, and doesn't do it twice (it doesn't create, send emails or charge). |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `net` | number | yes | The net you want to pay for a full period, in pesos. (greater than 0 and up to 10000000) |
| `employee` | string |  | An employee (emp_…): takes their pay frequency, zone and benefits (aguinaldo, vacation premium, seniority, vouchers and savings fund), and their SDI ÷ salary factor if they have them. |
| `periodicity` | `02`, `03`, `04`, `05` |  | 02 weekly, 03 every 14 days, 04 every two weeks or 05 monthly. Without employee, required. |
| `border_zone` | boolean |  | In the northern border free zone (its minimum wage). |
| `start_date` | string |  | Hire date: the vacation days for their seniority. |
| `aguinaldo_days` | integer |  | Days of aguinaldo per year (at least 15). (from 15 to 365) |
| `vacation_premium` | number |  | Vacation premium as a fraction (at least 0.25). (from 0.25 to 5) |
| `pantry_vouchers` | number |  | Grocery vouchers per month. (from 0 to 1000000) |
| `savings_fund_rate` | number |  | Savings fund as a fraction of the salary (up to 0.13). (from 0 to 0.13) |

Example:

```json
{
  "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
  "net": 8000
}
```

## With the TypeScript SDK

```ts
import { Fiscalisto } from "fiscalisto";

// La llave viene de FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const netToGross = await fiscalisto.payrollReceipts.netToGross({
  employee: "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
  net: 8000,
}, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

# La llave viene de FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

net_to_gross = fiscalisto.payroll_receipts.net_to_gross({
    "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
    "net": 8000,
}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$netToGross = $fiscalisto->payrollReceipts->netToGross([
    'employee' => 'emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV',
    'net' => 8000,
], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var netToGross = await fiscalisto.PayrollReceipts.NetToGrossAsync(new NetToGrossParams
{
    Employee = "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
    Net = 8000,
}, new RequestOptions { IdempotencyKey = "pedido-A-1042" });
```

## With the Go SDK

```go
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// La llave viene de FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	netToGross, err := client.PayrollReceipts.NetToGross(ctx, &fiscalisto.NetToGrossParams{
		Employee: fiscalisto.String("emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV"),
		Net:      8000,
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *netToGross)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.NetToGrossParams;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var netToGross = fiscalisto.payrollReceipts().netToGross(new NetToGrossParams()
        .setEmployee("emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV")
        .setNet(8000), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(netToGross);
```

## Response 200

OK.

A `NetToGross` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"net_to_gross"` | yes | What kind of object it is («invoice», «customer»…). |
| `employee` | string or null | yes | The employee (emp_…) whose benefits it used, or null. |
| `periodicity` | string | yes | 02 weekly, 03 biweekly (14 days), 04 semimonthly or 05 monthly. |
| `net_requested` | number | yes | The net requested. |
| `daily_salary` | number | yes | The daily salary whose receipt pays at least that net (rounded up to the cent). |
| `integrated_daily_salary` | number | yes | Their integrated daily salary (SDI) with their benefits factor. |
| `period` | object | yes | The period it was calculated with (the current one for the frequency). |
| `period.start` | string | yes | First day of the period (FechaInicialPago), YYYY-MM-DD. |
| `period.end` | string | yes | Last day of the period (FechaFinalPago), YYYY-MM-DD. |
| `days` | number | yes | The days paid in a full period. |
| `perceptions` | number | yes | The receipt's total earnings. |
| `deductions` | number | yes | Total deductions (ISR, IMSS, savings fund). |
| `taxes_withheld` | number | yes | ISR withheld. |
| `other_payments` | number | yes | Other payments. |
| `net` | number | yes | The receipt's net with that salary. |

```json
{
  "object": "net_to_gross",
  "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
  "periodicity": "04",
  "net_requested": 8000,
  "daily_salary": 620.46,
  "integrated_daily_salary": 652.79,
  "period": {
    "start": "2026-11-16",
    "end": "2026-11-30"
  },
  "days": 15,
  "perceptions": 9306.9,
  "deductions": 1306.82,
  "taxes_withheld": 1056.21,
  "other_payments": 0,
  "net": 8000.08
}
```

## Errors

- `feature_not_in_plan` (403): Live, this part of the API (inventario, portal de proveedores, pedidos, comprobación de gastos) follows the empresa's plan, as in the app: it comes with Operaciones (added to any paid plan; included in Corporativo). The books (the /v1/accounting routes except DIOT, cross checks, IVA refunds and fixed assets) come with Contabilidad (added to Independiente, Emprendedor or Negocio; included in Despacho and Corporativo): without it, changing the books answers this error, and reading them works only up to the last month it had it. Add either in Ajustes › Plan y pagos; test mode has everything.
- `issuer_archived` (400): The issuer is archived and no longer stamps. Its documents can still be read and canceled.
- `issuer_linked_empresa` (403): That issuer is an empresa of the app connected to your account: through the API it only offers its Portal de proveedores (/v1/portal_suppliers and /v1/supplier_invoices) and, once someone who may pay suppliers and change Configurar pagos turned them on, its supplier payouts (/v1/payouts and /v1/payroll_payouts). It also stops when whoever connected it (or turned its payouts on) no longer has that permission in the empresa: message_es says which. Do everything else in the app.
- `issuer_missing` (404): There is no such issuer in the account (or it belongs to the other mode).
- `issuer_not_allowed` (403): This key can't use that issuer.
- `issuer_required` (400): The account has several issuers and the request doesn't say which: send `issuer` (iss_…).
- `livemode_mismatch` (400): The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.
- `resource_missing` (404): There's no object with that id (or it belongs to another issuer or the other mode).

Plus those of any call (key, fields, limits): https://fiscalisto.com/en/docs/api/errores.md.
