Calculate payroll for multiple employees
curl --request POST \
--url https://api.example.com/v1/payroll/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"country": "MX",
"scheme": "ordinario",
"year": 2024,
"period": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
},
"employer": {
"id": "employer_001",
"rfc": "ABC123456XY0"
},
"employees": [
{
"id": "emp_001",
"daily_salary": 800,
"monthly_salary": 24000,
"factor_integracion": 1.0493,
"risk_class_rate": 0.00522,
"overtime_amount": "0",
"sunday_bonus_days": 0,
"grocery_voucher_amount": "0",
"infonavit_credit_amount": "0",
"num_dependentes_irrf": 0,
"vale_transporte_amount": "0",
"pensao_alimenticia_amount": "0",
"decimo_terceiro_amount": "0",
"ferias_amount": "0",
"rat_fap_rate": "0.02",
"cantidad_hijos": 0,
"cantidad_hijos_incapacitados": 0,
"cuota_sindical_rate": "0",
"afp_rate": "0",
"commission_amount": "0",
"asignacion_familiar_amount": "0",
"colacion_amount": "0",
"movilizacion_amount": "0",
"horas_recargo_nocturno": "0",
"horas_dominicales_diurnas": "0",
"horas_dominicales_nocturnas": "0",
"horas_extra_diurnas": "0",
"horas_extra_nocturnas": "0",
"horas_extra_dominicales_diurnas": "0",
"horas_extra_dominicales_nocturnas": "0",
"overrides": {
"bono_puntualidad": true
},
"period_override": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
}
}
],
"options": {
"include_audit_trail": true,
"include_diagram": false,
"precision": 2,
"supersedes": "01HX9B2KM3V4W5X6Y7Z8A9B0CD",
"metadata": {
"run": "nomina-2026-09-q1"
},
"async": false,
"fail_fast": false
}
}
'import requests
url = "https://api.example.com/v1/payroll/batch"
payload = {
"country": "MX",
"scheme": "ordinario",
"year": 2024,
"period": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
},
"employer": {
"id": "employer_001",
"rfc": "ABC123456XY0"
},
"employees": [
{
"id": "emp_001",
"daily_salary": 800,
"monthly_salary": 24000,
"factor_integracion": 1.0493,
"risk_class_rate": 0.00522,
"overtime_amount": "0",
"sunday_bonus_days": 0,
"grocery_voucher_amount": "0",
"infonavit_credit_amount": "0",
"num_dependentes_irrf": 0,
"vale_transporte_amount": "0",
"pensao_alimenticia_amount": "0",
"decimo_terceiro_amount": "0",
"ferias_amount": "0",
"rat_fap_rate": "0.02",
"cantidad_hijos": 0,
"cantidad_hijos_incapacitados": 0,
"cuota_sindical_rate": "0",
"afp_rate": "0",
"commission_amount": "0",
"asignacion_familiar_amount": "0",
"colacion_amount": "0",
"movilizacion_amount": "0",
"horas_recargo_nocturno": "0",
"horas_dominicales_diurnas": "0",
"horas_dominicales_nocturnas": "0",
"horas_extra_diurnas": "0",
"horas_extra_nocturnas": "0",
"horas_extra_dominicales_diurnas": "0",
"horas_extra_dominicales_nocturnas": "0",
"overrides": { "bono_puntualidad": True },
"period_override": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
}
}
],
"options": {
"include_audit_trail": True,
"include_diagram": False,
"precision": 2,
"supersedes": "01HX9B2KM3V4W5X6Y7Z8A9B0CD",
"metadata": { "run": "nomina-2026-09-q1" },
"async": False,
"fail_fast": False
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
country: 'MX',
scheme: 'ordinario',
year: 2024,
period: {type: 'monthly', start_date: '2024-03-01', end_date: '2024-03-31', days: 30},
employer: {id: 'employer_001', rfc: 'ABC123456XY0'},
employees: [
{
id: 'emp_001',
daily_salary: 800,
monthly_salary: 24000,
factor_integracion: 1.0493,
risk_class_rate: 0.00522,
overtime_amount: '0',
sunday_bonus_days: 0,
grocery_voucher_amount: '0',
infonavit_credit_amount: '0',
num_dependentes_irrf: 0,
vale_transporte_amount: '0',
pensao_alimenticia_amount: '0',
decimo_terceiro_amount: '0',
ferias_amount: '0',
rat_fap_rate: '0.02',
cantidad_hijos: 0,
cantidad_hijos_incapacitados: 0,
cuota_sindical_rate: '0',
afp_rate: '0',
commission_amount: '0',
asignacion_familiar_amount: '0',
colacion_amount: '0',
movilizacion_amount: '0',
horas_recargo_nocturno: '0',
horas_dominicales_diurnas: '0',
horas_dominicales_nocturnas: '0',
horas_extra_diurnas: '0',
horas_extra_nocturnas: '0',
horas_extra_dominicales_diurnas: '0',
horas_extra_dominicales_nocturnas: '0',
overrides: {bono_puntualidad: true},
period_override: {type: 'monthly', start_date: '2024-03-01', end_date: '2024-03-31', days: 30}
}
],
options: {
include_audit_trail: true,
include_diagram: false,
precision: 2,
supersedes: '01HX9B2KM3V4W5X6Y7Z8A9B0CD',
metadata: {run: 'nomina-2026-09-q1'},
async: false,
fail_fast: false
}
})
};
fetch('https://api.example.com/v1/payroll/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/payroll/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'country' => 'MX',
'scheme' => 'ordinario',
'year' => 2024,
'period' => [
'type' => 'monthly',
'start_date' => '2024-03-01',
'end_date' => '2024-03-31',
'days' => 30
],
'employer' => [
'id' => 'employer_001',
'rfc' => 'ABC123456XY0'
],
'employees' => [
[
'id' => 'emp_001',
'daily_salary' => 800,
'monthly_salary' => 24000,
'factor_integracion' => 1.0493,
'risk_class_rate' => 0.00522,
'overtime_amount' => '0',
'sunday_bonus_days' => 0,
'grocery_voucher_amount' => '0',
'infonavit_credit_amount' => '0',
'num_dependentes_irrf' => 0,
'vale_transporte_amount' => '0',
'pensao_alimenticia_amount' => '0',
'decimo_terceiro_amount' => '0',
'ferias_amount' => '0',
'rat_fap_rate' => '0.02',
'cantidad_hijos' => 0,
'cantidad_hijos_incapacitados' => 0,
'cuota_sindical_rate' => '0',
'afp_rate' => '0',
'commission_amount' => '0',
'asignacion_familiar_amount' => '0',
'colacion_amount' => '0',
'movilizacion_amount' => '0',
'horas_recargo_nocturno' => '0',
'horas_dominicales_diurnas' => '0',
'horas_dominicales_nocturnas' => '0',
'horas_extra_diurnas' => '0',
'horas_extra_nocturnas' => '0',
'horas_extra_dominicales_diurnas' => '0',
'horas_extra_dominicales_nocturnas' => '0',
'overrides' => [
'bono_puntualidad' => true
],
'period_override' => [
'type' => 'monthly',
'start_date' => '2024-03-01',
'end_date' => '2024-03-31',
'days' => 30
]
]
],
'options' => [
'include_audit_trail' => true,
'include_diagram' => false,
'precision' => 2,
'supersedes' => '01HX9B2KM3V4W5X6Y7Z8A9B0CD',
'metadata' => [
'run' => 'nomina-2026-09-q1'
],
'async' => false,
'fail_fast' => false
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payroll/batch"
payload := strings.NewReader("{\n \"country\": \"MX\",\n \"scheme\": \"ordinario\",\n \"year\": 2024,\n \"period\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n },\n \"employer\": {\n \"id\": \"employer_001\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"emp_001\",\n \"daily_salary\": 800,\n \"monthly_salary\": 24000,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00522,\n \"overtime_amount\": \"0\",\n \"sunday_bonus_days\": 0,\n \"grocery_voucher_amount\": \"0\",\n \"infonavit_credit_amount\": \"0\",\n \"num_dependentes_irrf\": 0,\n \"vale_transporte_amount\": \"0\",\n \"pensao_alimenticia_amount\": \"0\",\n \"decimo_terceiro_amount\": \"0\",\n \"ferias_amount\": \"0\",\n \"rat_fap_rate\": \"0.02\",\n \"cantidad_hijos\": 0,\n \"cantidad_hijos_incapacitados\": 0,\n \"cuota_sindical_rate\": \"0\",\n \"afp_rate\": \"0\",\n \"commission_amount\": \"0\",\n \"asignacion_familiar_amount\": \"0\",\n \"colacion_amount\": \"0\",\n \"movilizacion_amount\": \"0\",\n \"horas_recargo_nocturno\": \"0\",\n \"horas_dominicales_diurnas\": \"0\",\n \"horas_dominicales_nocturnas\": \"0\",\n \"horas_extra_diurnas\": \"0\",\n \"horas_extra_nocturnas\": \"0\",\n \"horas_extra_dominicales_diurnas\": \"0\",\n \"horas_extra_dominicales_nocturnas\": \"0\",\n \"overrides\": {\n \"bono_puntualidad\": true\n },\n \"period_override\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\n \"supersedes\": \"01HX9B2KM3V4W5X6Y7Z8A9B0CD\",\n \"metadata\": {\n \"run\": \"nomina-2026-09-q1\"\n },\n \"async\": false,\n \"fail_fast\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/payroll/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"MX\",\n \"scheme\": \"ordinario\",\n \"year\": 2024,\n \"period\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n },\n \"employer\": {\n \"id\": \"employer_001\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"emp_001\",\n \"daily_salary\": 800,\n \"monthly_salary\": 24000,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00522,\n \"overtime_amount\": \"0\",\n \"sunday_bonus_days\": 0,\n \"grocery_voucher_amount\": \"0\",\n \"infonavit_credit_amount\": \"0\",\n \"num_dependentes_irrf\": 0,\n \"vale_transporte_amount\": \"0\",\n \"pensao_alimenticia_amount\": \"0\",\n \"decimo_terceiro_amount\": \"0\",\n \"ferias_amount\": \"0\",\n \"rat_fap_rate\": \"0.02\",\n \"cantidad_hijos\": 0,\n \"cantidad_hijos_incapacitados\": 0,\n \"cuota_sindical_rate\": \"0\",\n \"afp_rate\": \"0\",\n \"commission_amount\": \"0\",\n \"asignacion_familiar_amount\": \"0\",\n \"colacion_amount\": \"0\",\n \"movilizacion_amount\": \"0\",\n \"horas_recargo_nocturno\": \"0\",\n \"horas_dominicales_diurnas\": \"0\",\n \"horas_dominicales_nocturnas\": \"0\",\n \"horas_extra_diurnas\": \"0\",\n \"horas_extra_nocturnas\": \"0\",\n \"horas_extra_dominicales_diurnas\": \"0\",\n \"horas_extra_dominicales_nocturnas\": \"0\",\n \"overrides\": {\n \"bono_puntualidad\": true\n },\n \"period_override\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\n \"supersedes\": \"01HX9B2KM3V4W5X6Y7Z8A9B0CD\",\n \"metadata\": {\n \"run\": \"nomina-2026-09-q1\"\n },\n \"async\": false,\n \"fail_fast\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payroll/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"MX\",\n \"scheme\": \"ordinario\",\n \"year\": 2024,\n \"period\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n },\n \"employer\": {\n \"id\": \"employer_001\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"emp_001\",\n \"daily_salary\": 800,\n \"monthly_salary\": 24000,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00522,\n \"overtime_amount\": \"0\",\n \"sunday_bonus_days\": 0,\n \"grocery_voucher_amount\": \"0\",\n \"infonavit_credit_amount\": \"0\",\n \"num_dependentes_irrf\": 0,\n \"vale_transporte_amount\": \"0\",\n \"pensao_alimenticia_amount\": \"0\",\n \"decimo_terceiro_amount\": \"0\",\n \"ferias_amount\": \"0\",\n \"rat_fap_rate\": \"0.02\",\n \"cantidad_hijos\": 0,\n \"cantidad_hijos_incapacitados\": 0,\n \"cuota_sindical_rate\": \"0\",\n \"afp_rate\": \"0\",\n \"commission_amount\": \"0\",\n \"asignacion_familiar_amount\": \"0\",\n \"colacion_amount\": \"0\",\n \"movilizacion_amount\": \"0\",\n \"horas_recargo_nocturno\": \"0\",\n \"horas_dominicales_diurnas\": \"0\",\n \"horas_dominicales_nocturnas\": \"0\",\n \"horas_extra_diurnas\": \"0\",\n \"horas_extra_nocturnas\": \"0\",\n \"horas_extra_dominicales_diurnas\": \"0\",\n \"horas_extra_dominicales_nocturnas\": \"0\",\n \"overrides\": {\n \"bono_puntualidad\": true\n },\n \"period_override\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\n \"supersedes\": \"01HX9B2KM3V4W5X6Y7Z8A9B0CD\",\n \"metadata\": {\n \"run\": \"nomina-2026-09-q1\"\n },\n \"async\": false,\n \"fail_fast\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"country": "<string>",
"scheme": "<string>",
"year": 123,
"total_requested": 123,
"total_succeeded": 123,
"total_failed": 123,
"results": [
{
"employee_id": "<string>",
"status": "success",
"calculation": {
"id": "01HX9B2KM3V4W5X6Y7Z8A9B0CD",
"country": "<string>",
"scheme": "<string>",
"year": 123,
"period": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
},
"employee_id": "<string>",
"summary": {
"gross_salary": "<string>",
"total_perceptions": "<string>",
"total_deductions": "<string>",
"net_salary": "<string>",
"employer_contributions_total": "<string>",
"employer_total_cost": "<string>"
},
"perceptions": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"taxable": true,
"imss_base": true,
"tags": [
"<string>"
]
}
],
"deductions": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"tags": [
"<string>"
],
"bracket_applied": {}
}
],
"taxable_bases": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"formula": "<string>"
}
],
"employer_contributions": [
{
"table_id": "<string>",
"label": "<string>",
"total": "<string>",
"components": [
{
"id": "<string>",
"label": "<string>",
"base": "<string>",
"rate": "<string>",
"amount": "<string>"
}
]
}
],
"dsl_version": "2024.2",
"computed_at": "2023-11-07T05:31:56Z",
"status": "success",
"audit_trail": [
{}
],
"period_basis": {
"type": "biweekly",
"sequence": 1,
"periods_in_month": 2,
"factor": "0.5",
"absorbs_residual": false,
"monthly_equivalent": {
"total_perceptions": "<string>",
"total_deductions": "<string>",
"net_salary": "<string>",
"employer_contributions_total": "<string>",
"employer_total_cost": "<string>"
},
"proration": "native"
},
"record": {
"rule_fingerprint": "sha256:b90834cebdc4224c3...",
"engine_version": "<string>",
"schema_version": 123,
"content_digest": "<string>",
"stored": true,
"batch_id": "<string>",
"supersedes_id": "<string>",
"metadata": {}
},
"warnings": [
{
"code": "FLAG_THRESHOLD_MISMATCH",
"field": "overrides.aplica_auxilio_transporte",
"message": "<string>",
"severity": "warning"
}
]
},
"error": {}
}
],
"computed_at": "2023-11-07T05:31:56Z",
"status": "completed"
}Payroll
Calculate payroll for multiple employees
Calculate payroll for 1–500 employees in a single request.
**Synchronous mode** (≤50 employees or `options.async=false`):
Returns all results immediately. P99 target: <2s for 50 employees.
**Asynchronous mode** (`options.async=true` with >50 employees):
Returns a job ID immediately (HTTP 202). Poll `GET /v1/payroll/jobs/{id}`
for results. Asynchronous batch is not fully implemented in v1 — the
endpoint returns a placeholder response indicating this.
**Error handling**: by default (`options.fail_fast=false`), employee-level
errors do not abort the batch. Failed employees appear in the response with
`status: "error"` and an error detail. Set `fail_fast=true` to abort on
the first error.
POST
/
v1
/
payroll
/
batch
Calculate payroll for multiple employees
curl --request POST \
--url https://api.example.com/v1/payroll/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"country": "MX",
"scheme": "ordinario",
"year": 2024,
"period": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
},
"employer": {
"id": "employer_001",
"rfc": "ABC123456XY0"
},
"employees": [
{
"id": "emp_001",
"daily_salary": 800,
"monthly_salary": 24000,
"factor_integracion": 1.0493,
"risk_class_rate": 0.00522,
"overtime_amount": "0",
"sunday_bonus_days": 0,
"grocery_voucher_amount": "0",
"infonavit_credit_amount": "0",
"num_dependentes_irrf": 0,
"vale_transporte_amount": "0",
"pensao_alimenticia_amount": "0",
"decimo_terceiro_amount": "0",
"ferias_amount": "0",
"rat_fap_rate": "0.02",
"cantidad_hijos": 0,
"cantidad_hijos_incapacitados": 0,
"cuota_sindical_rate": "0",
"afp_rate": "0",
"commission_amount": "0",
"asignacion_familiar_amount": "0",
"colacion_amount": "0",
"movilizacion_amount": "0",
"horas_recargo_nocturno": "0",
"horas_dominicales_diurnas": "0",
"horas_dominicales_nocturnas": "0",
"horas_extra_diurnas": "0",
"horas_extra_nocturnas": "0",
"horas_extra_dominicales_diurnas": "0",
"horas_extra_dominicales_nocturnas": "0",
"overrides": {
"bono_puntualidad": true
},
"period_override": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
}
}
],
"options": {
"include_audit_trail": true,
"include_diagram": false,
"precision": 2,
"supersedes": "01HX9B2KM3V4W5X6Y7Z8A9B0CD",
"metadata": {
"run": "nomina-2026-09-q1"
},
"async": false,
"fail_fast": false
}
}
'import requests
url = "https://api.example.com/v1/payroll/batch"
payload = {
"country": "MX",
"scheme": "ordinario",
"year": 2024,
"period": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
},
"employer": {
"id": "employer_001",
"rfc": "ABC123456XY0"
},
"employees": [
{
"id": "emp_001",
"daily_salary": 800,
"monthly_salary": 24000,
"factor_integracion": 1.0493,
"risk_class_rate": 0.00522,
"overtime_amount": "0",
"sunday_bonus_days": 0,
"grocery_voucher_amount": "0",
"infonavit_credit_amount": "0",
"num_dependentes_irrf": 0,
"vale_transporte_amount": "0",
"pensao_alimenticia_amount": "0",
"decimo_terceiro_amount": "0",
"ferias_amount": "0",
"rat_fap_rate": "0.02",
"cantidad_hijos": 0,
"cantidad_hijos_incapacitados": 0,
"cuota_sindical_rate": "0",
"afp_rate": "0",
"commission_amount": "0",
"asignacion_familiar_amount": "0",
"colacion_amount": "0",
"movilizacion_amount": "0",
"horas_recargo_nocturno": "0",
"horas_dominicales_diurnas": "0",
"horas_dominicales_nocturnas": "0",
"horas_extra_diurnas": "0",
"horas_extra_nocturnas": "0",
"horas_extra_dominicales_diurnas": "0",
"horas_extra_dominicales_nocturnas": "0",
"overrides": { "bono_puntualidad": True },
"period_override": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
}
}
],
"options": {
"include_audit_trail": True,
"include_diagram": False,
"precision": 2,
"supersedes": "01HX9B2KM3V4W5X6Y7Z8A9B0CD",
"metadata": { "run": "nomina-2026-09-q1" },
"async": False,
"fail_fast": False
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
country: 'MX',
scheme: 'ordinario',
year: 2024,
period: {type: 'monthly', start_date: '2024-03-01', end_date: '2024-03-31', days: 30},
employer: {id: 'employer_001', rfc: 'ABC123456XY0'},
employees: [
{
id: 'emp_001',
daily_salary: 800,
monthly_salary: 24000,
factor_integracion: 1.0493,
risk_class_rate: 0.00522,
overtime_amount: '0',
sunday_bonus_days: 0,
grocery_voucher_amount: '0',
infonavit_credit_amount: '0',
num_dependentes_irrf: 0,
vale_transporte_amount: '0',
pensao_alimenticia_amount: '0',
decimo_terceiro_amount: '0',
ferias_amount: '0',
rat_fap_rate: '0.02',
cantidad_hijos: 0,
cantidad_hijos_incapacitados: 0,
cuota_sindical_rate: '0',
afp_rate: '0',
commission_amount: '0',
asignacion_familiar_amount: '0',
colacion_amount: '0',
movilizacion_amount: '0',
horas_recargo_nocturno: '0',
horas_dominicales_diurnas: '0',
horas_dominicales_nocturnas: '0',
horas_extra_diurnas: '0',
horas_extra_nocturnas: '0',
horas_extra_dominicales_diurnas: '0',
horas_extra_dominicales_nocturnas: '0',
overrides: {bono_puntualidad: true},
period_override: {type: 'monthly', start_date: '2024-03-01', end_date: '2024-03-31', days: 30}
}
],
options: {
include_audit_trail: true,
include_diagram: false,
precision: 2,
supersedes: '01HX9B2KM3V4W5X6Y7Z8A9B0CD',
metadata: {run: 'nomina-2026-09-q1'},
async: false,
fail_fast: false
}
})
};
fetch('https://api.example.com/v1/payroll/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/payroll/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'country' => 'MX',
'scheme' => 'ordinario',
'year' => 2024,
'period' => [
'type' => 'monthly',
'start_date' => '2024-03-01',
'end_date' => '2024-03-31',
'days' => 30
],
'employer' => [
'id' => 'employer_001',
'rfc' => 'ABC123456XY0'
],
'employees' => [
[
'id' => 'emp_001',
'daily_salary' => 800,
'monthly_salary' => 24000,
'factor_integracion' => 1.0493,
'risk_class_rate' => 0.00522,
'overtime_amount' => '0',
'sunday_bonus_days' => 0,
'grocery_voucher_amount' => '0',
'infonavit_credit_amount' => '0',
'num_dependentes_irrf' => 0,
'vale_transporte_amount' => '0',
'pensao_alimenticia_amount' => '0',
'decimo_terceiro_amount' => '0',
'ferias_amount' => '0',
'rat_fap_rate' => '0.02',
'cantidad_hijos' => 0,
'cantidad_hijos_incapacitados' => 0,
'cuota_sindical_rate' => '0',
'afp_rate' => '0',
'commission_amount' => '0',
'asignacion_familiar_amount' => '0',
'colacion_amount' => '0',
'movilizacion_amount' => '0',
'horas_recargo_nocturno' => '0',
'horas_dominicales_diurnas' => '0',
'horas_dominicales_nocturnas' => '0',
'horas_extra_diurnas' => '0',
'horas_extra_nocturnas' => '0',
'horas_extra_dominicales_diurnas' => '0',
'horas_extra_dominicales_nocturnas' => '0',
'overrides' => [
'bono_puntualidad' => true
],
'period_override' => [
'type' => 'monthly',
'start_date' => '2024-03-01',
'end_date' => '2024-03-31',
'days' => 30
]
]
],
'options' => [
'include_audit_trail' => true,
'include_diagram' => false,
'precision' => 2,
'supersedes' => '01HX9B2KM3V4W5X6Y7Z8A9B0CD',
'metadata' => [
'run' => 'nomina-2026-09-q1'
],
'async' => false,
'fail_fast' => false
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payroll/batch"
payload := strings.NewReader("{\n \"country\": \"MX\",\n \"scheme\": \"ordinario\",\n \"year\": 2024,\n \"period\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n },\n \"employer\": {\n \"id\": \"employer_001\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"emp_001\",\n \"daily_salary\": 800,\n \"monthly_salary\": 24000,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00522,\n \"overtime_amount\": \"0\",\n \"sunday_bonus_days\": 0,\n \"grocery_voucher_amount\": \"0\",\n \"infonavit_credit_amount\": \"0\",\n \"num_dependentes_irrf\": 0,\n \"vale_transporte_amount\": \"0\",\n \"pensao_alimenticia_amount\": \"0\",\n \"decimo_terceiro_amount\": \"0\",\n \"ferias_amount\": \"0\",\n \"rat_fap_rate\": \"0.02\",\n \"cantidad_hijos\": 0,\n \"cantidad_hijos_incapacitados\": 0,\n \"cuota_sindical_rate\": \"0\",\n \"afp_rate\": \"0\",\n \"commission_amount\": \"0\",\n \"asignacion_familiar_amount\": \"0\",\n \"colacion_amount\": \"0\",\n \"movilizacion_amount\": \"0\",\n \"horas_recargo_nocturno\": \"0\",\n \"horas_dominicales_diurnas\": \"0\",\n \"horas_dominicales_nocturnas\": \"0\",\n \"horas_extra_diurnas\": \"0\",\n \"horas_extra_nocturnas\": \"0\",\n \"horas_extra_dominicales_diurnas\": \"0\",\n \"horas_extra_dominicales_nocturnas\": \"0\",\n \"overrides\": {\n \"bono_puntualidad\": true\n },\n \"period_override\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\n \"supersedes\": \"01HX9B2KM3V4W5X6Y7Z8A9B0CD\",\n \"metadata\": {\n \"run\": \"nomina-2026-09-q1\"\n },\n \"async\": false,\n \"fail_fast\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/payroll/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"MX\",\n \"scheme\": \"ordinario\",\n \"year\": 2024,\n \"period\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n },\n \"employer\": {\n \"id\": \"employer_001\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"emp_001\",\n \"daily_salary\": 800,\n \"monthly_salary\": 24000,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00522,\n \"overtime_amount\": \"0\",\n \"sunday_bonus_days\": 0,\n \"grocery_voucher_amount\": \"0\",\n \"infonavit_credit_amount\": \"0\",\n \"num_dependentes_irrf\": 0,\n \"vale_transporte_amount\": \"0\",\n \"pensao_alimenticia_amount\": \"0\",\n \"decimo_terceiro_amount\": \"0\",\n \"ferias_amount\": \"0\",\n \"rat_fap_rate\": \"0.02\",\n \"cantidad_hijos\": 0,\n \"cantidad_hijos_incapacitados\": 0,\n \"cuota_sindical_rate\": \"0\",\n \"afp_rate\": \"0\",\n \"commission_amount\": \"0\",\n \"asignacion_familiar_amount\": \"0\",\n \"colacion_amount\": \"0\",\n \"movilizacion_amount\": \"0\",\n \"horas_recargo_nocturno\": \"0\",\n \"horas_dominicales_diurnas\": \"0\",\n \"horas_dominicales_nocturnas\": \"0\",\n \"horas_extra_diurnas\": \"0\",\n \"horas_extra_nocturnas\": \"0\",\n \"horas_extra_dominicales_diurnas\": \"0\",\n \"horas_extra_dominicales_nocturnas\": \"0\",\n \"overrides\": {\n \"bono_puntualidad\": true\n },\n \"period_override\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\n \"supersedes\": \"01HX9B2KM3V4W5X6Y7Z8A9B0CD\",\n \"metadata\": {\n \"run\": \"nomina-2026-09-q1\"\n },\n \"async\": false,\n \"fail_fast\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payroll/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"MX\",\n \"scheme\": \"ordinario\",\n \"year\": 2024,\n \"period\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n },\n \"employer\": {\n \"id\": \"employer_001\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"emp_001\",\n \"daily_salary\": 800,\n \"monthly_salary\": 24000,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00522,\n \"overtime_amount\": \"0\",\n \"sunday_bonus_days\": 0,\n \"grocery_voucher_amount\": \"0\",\n \"infonavit_credit_amount\": \"0\",\n \"num_dependentes_irrf\": 0,\n \"vale_transporte_amount\": \"0\",\n \"pensao_alimenticia_amount\": \"0\",\n \"decimo_terceiro_amount\": \"0\",\n \"ferias_amount\": \"0\",\n \"rat_fap_rate\": \"0.02\",\n \"cantidad_hijos\": 0,\n \"cantidad_hijos_incapacitados\": 0,\n \"cuota_sindical_rate\": \"0\",\n \"afp_rate\": \"0\",\n \"commission_amount\": \"0\",\n \"asignacion_familiar_amount\": \"0\",\n \"colacion_amount\": \"0\",\n \"movilizacion_amount\": \"0\",\n \"horas_recargo_nocturno\": \"0\",\n \"horas_dominicales_diurnas\": \"0\",\n \"horas_dominicales_nocturnas\": \"0\",\n \"horas_extra_diurnas\": \"0\",\n \"horas_extra_nocturnas\": \"0\",\n \"horas_extra_dominicales_diurnas\": \"0\",\n \"horas_extra_dominicales_nocturnas\": \"0\",\n \"overrides\": {\n \"bono_puntualidad\": true\n },\n \"period_override\": {\n \"type\": \"monthly\",\n \"start_date\": \"2024-03-01\",\n \"end_date\": \"2024-03-31\",\n \"days\": 30\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\n \"supersedes\": \"01HX9B2KM3V4W5X6Y7Z8A9B0CD\",\n \"metadata\": {\n \"run\": \"nomina-2026-09-q1\"\n },\n \"async\": false,\n \"fail_fast\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"country": "<string>",
"scheme": "<string>",
"year": 123,
"total_requested": 123,
"total_succeeded": 123,
"total_failed": 123,
"results": [
{
"employee_id": "<string>",
"status": "success",
"calculation": {
"id": "01HX9B2KM3V4W5X6Y7Z8A9B0CD",
"country": "<string>",
"scheme": "<string>",
"year": 123,
"period": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
},
"employee_id": "<string>",
"summary": {
"gross_salary": "<string>",
"total_perceptions": "<string>",
"total_deductions": "<string>",
"net_salary": "<string>",
"employer_contributions_total": "<string>",
"employer_total_cost": "<string>"
},
"perceptions": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"taxable": true,
"imss_base": true,
"tags": [
"<string>"
]
}
],
"deductions": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"tags": [
"<string>"
],
"bracket_applied": {}
}
],
"taxable_bases": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"formula": "<string>"
}
],
"employer_contributions": [
{
"table_id": "<string>",
"label": "<string>",
"total": "<string>",
"components": [
{
"id": "<string>",
"label": "<string>",
"base": "<string>",
"rate": "<string>",
"amount": "<string>"
}
]
}
],
"dsl_version": "2024.2",
"computed_at": "2023-11-07T05:31:56Z",
"status": "success",
"audit_trail": [
{}
],
"period_basis": {
"type": "biweekly",
"sequence": 1,
"periods_in_month": 2,
"factor": "0.5",
"absorbs_residual": false,
"monthly_equivalent": {
"total_perceptions": "<string>",
"total_deductions": "<string>",
"net_salary": "<string>",
"employer_contributions_total": "<string>",
"employer_total_cost": "<string>"
},
"proration": "native"
},
"record": {
"rule_fingerprint": "sha256:b90834cebdc4224c3...",
"engine_version": "<string>",
"schema_version": 123,
"content_digest": "<string>",
"stored": true,
"batch_id": "<string>",
"supersedes_id": "<string>",
"metadata": {}
},
"warnings": [
{
"code": "FLAG_THRESHOLD_MISMATCH",
"field": "overrides.aplica_auxilio_transporte",
"message": "<string>",
"severity": "warning"
}
]
},
"error": {}
}
],
"computed_at": "2023-11-07T05:31:56Z",
"status": "completed"
}Authorizations
API key authentication. Send your API key as: Authorization: Bearer <your_api_key>
Headers
Body
application/json
Request body for POST /v1/payroll/batch.
Processes up to 500 employees in one request. Employees ≤ 50 are processed synchronously. Above 50 employees, set options.async=true to receive a job ID for polling.
Pattern:
^[A-Z]{2}$Example:
"MX"
Example:
"ordinario"
Required range:
2020 <= x <= 2030Example:
2024
Payroll period definition.
Show child attributes
Show child attributes
Employer-side inputs for a payroll calculation.
Show child attributes
Show child attributes
List of employees to calculate. 1–500 employees per request.
Required array length:
1 - 500 elementsShow child attributes
Show child attributes
Options specific to batch requests.
Show child attributes
Show child attributes
Response
Batch completed synchronously.
- BatchResponse
- AsyncBatchResponse
Synchronous batch calculation response (≤50 employees).
Batch job ID (ULID).
Show child attributes
Show child attributes
Allowed value:
"completed"