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": "<string>",
"scheme": "<string>",
"year": 2025,
"period": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
},
"employer": {
"id": "<string>",
"rfc": "ABC123456XY0"
},
"employees": [
{
"id": "<string>",
"daily_salary": 800,
"monthly_salary": 1,
"factor_integracion": 1.0493,
"risk_class_rate": 0.00543,
"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",
"overrides": {},
"period_override": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
}
}
],
"options": {
"include_audit_trail": true,
"include_diagram": false,
"precision": 2,
"async": false,
"fail_fast": false
}
}
'import requests
url = "https://api.example.com/v1/payroll/batch"
payload = {
"country": "<string>",
"scheme": "<string>",
"year": 2025,
"period": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
},
"employer": {
"id": "<string>",
"rfc": "ABC123456XY0"
},
"employees": [
{
"id": "<string>",
"daily_salary": 800,
"monthly_salary": 1,
"factor_integracion": 1.0493,
"risk_class_rate": 0.00543,
"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",
"overrides": {},
"period_override": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
}
}
],
"options": {
"include_audit_trail": True,
"include_diagram": False,
"precision": 2,
"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: '<string>',
scheme: '<string>',
year: 2025,
period: {start_date: '2023-12-25', end_date: '2023-12-25', days: 16},
employer: {id: '<string>', rfc: 'ABC123456XY0'},
employees: [
{
id: '<string>',
daily_salary: 800,
monthly_salary: 1,
factor_integracion: 1.0493,
risk_class_rate: 0.00543,
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',
overrides: {},
period_override: {start_date: '2023-12-25', end_date: '2023-12-25', days: 16}
}
],
options: {
include_audit_trail: true,
include_diagram: false,
precision: 2,
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' => '<string>',
'scheme' => '<string>',
'year' => 2025,
'period' => [
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'days' => 16
],
'employer' => [
'id' => '<string>',
'rfc' => 'ABC123456XY0'
],
'employees' => [
[
'id' => '<string>',
'daily_salary' => 800,
'monthly_salary' => 1,
'factor_integracion' => 1.0493,
'risk_class_rate' => 0.00543,
'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',
'overrides' => [
],
'period_override' => [
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'days' => 16
]
]
],
'options' => [
'include_audit_trail' => true,
'include_diagram' => false,
'precision' => 2,
'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\": \"<string>\",\n \"scheme\": \"<string>\",\n \"year\": 2025,\n \"period\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n },\n \"employer\": {\n \"id\": \"<string>\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"<string>\",\n \"daily_salary\": 800,\n \"monthly_salary\": 1,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00543,\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 \"overrides\": {},\n \"period_override\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\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\": \"<string>\",\n \"scheme\": \"<string>\",\n \"year\": 2025,\n \"period\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n },\n \"employer\": {\n \"id\": \"<string>\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"<string>\",\n \"daily_salary\": 800,\n \"monthly_salary\": 1,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00543,\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 \"overrides\": {},\n \"period_override\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\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\": \"<string>\",\n \"scheme\": \"<string>\",\n \"year\": 2025,\n \"period\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n },\n \"employer\": {\n \"id\": \"<string>\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"<string>\",\n \"daily_salary\": 800,\n \"monthly_salary\": 1,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00543,\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 \"overrides\": {},\n \"period_override\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\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>",
"calculation": {
"id": "<string>",
"country": "<string>",
"scheme": "<string>",
"year": 123,
"period": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
},
"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": "<string>",
"computed_at": "2023-11-07T05:31:56Z",
"status": "success",
"audit_trail": [
{}
]
},
"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": "<string>",
"scheme": "<string>",
"year": 2025,
"period": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
},
"employer": {
"id": "<string>",
"rfc": "ABC123456XY0"
},
"employees": [
{
"id": "<string>",
"daily_salary": 800,
"monthly_salary": 1,
"factor_integracion": 1.0493,
"risk_class_rate": 0.00543,
"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",
"overrides": {},
"period_override": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
}
}
],
"options": {
"include_audit_trail": true,
"include_diagram": false,
"precision": 2,
"async": false,
"fail_fast": false
}
}
'import requests
url = "https://api.example.com/v1/payroll/batch"
payload = {
"country": "<string>",
"scheme": "<string>",
"year": 2025,
"period": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
},
"employer": {
"id": "<string>",
"rfc": "ABC123456XY0"
},
"employees": [
{
"id": "<string>",
"daily_salary": 800,
"monthly_salary": 1,
"factor_integracion": 1.0493,
"risk_class_rate": 0.00543,
"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",
"overrides": {},
"period_override": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
}
}
],
"options": {
"include_audit_trail": True,
"include_diagram": False,
"precision": 2,
"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: '<string>',
scheme: '<string>',
year: 2025,
period: {start_date: '2023-12-25', end_date: '2023-12-25', days: 16},
employer: {id: '<string>', rfc: 'ABC123456XY0'},
employees: [
{
id: '<string>',
daily_salary: 800,
monthly_salary: 1,
factor_integracion: 1.0493,
risk_class_rate: 0.00543,
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',
overrides: {},
period_override: {start_date: '2023-12-25', end_date: '2023-12-25', days: 16}
}
],
options: {
include_audit_trail: true,
include_diagram: false,
precision: 2,
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' => '<string>',
'scheme' => '<string>',
'year' => 2025,
'period' => [
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'days' => 16
],
'employer' => [
'id' => '<string>',
'rfc' => 'ABC123456XY0'
],
'employees' => [
[
'id' => '<string>',
'daily_salary' => 800,
'monthly_salary' => 1,
'factor_integracion' => 1.0493,
'risk_class_rate' => 0.00543,
'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',
'overrides' => [
],
'period_override' => [
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'days' => 16
]
]
],
'options' => [
'include_audit_trail' => true,
'include_diagram' => false,
'precision' => 2,
'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\": \"<string>\",\n \"scheme\": \"<string>\",\n \"year\": 2025,\n \"period\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n },\n \"employer\": {\n \"id\": \"<string>\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"<string>\",\n \"daily_salary\": 800,\n \"monthly_salary\": 1,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00543,\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 \"overrides\": {},\n \"period_override\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\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\": \"<string>\",\n \"scheme\": \"<string>\",\n \"year\": 2025,\n \"period\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n },\n \"employer\": {\n \"id\": \"<string>\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"<string>\",\n \"daily_salary\": 800,\n \"monthly_salary\": 1,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00543,\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 \"overrides\": {},\n \"period_override\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\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\": \"<string>\",\n \"scheme\": \"<string>\",\n \"year\": 2025,\n \"period\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n },\n \"employer\": {\n \"id\": \"<string>\",\n \"rfc\": \"ABC123456XY0\"\n },\n \"employees\": [\n {\n \"id\": \"<string>\",\n \"daily_salary\": 800,\n \"monthly_salary\": 1,\n \"factor_integracion\": 1.0493,\n \"risk_class_rate\": 0.00543,\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 \"overrides\": {},\n \"period_override\": {\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"days\": 16\n }\n }\n ],\n \"options\": {\n \"include_audit_trail\": true,\n \"include_diagram\": false,\n \"precision\": 2,\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>",
"calculation": {
"id": "<string>",
"country": "<string>",
"scheme": "<string>",
"year": 123,
"period": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"days": 16
},
"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": "<string>",
"computed_at": "2023-11-07T05:31:56Z",
"status": "success",
"audit_trail": [
{}
]
},
"error": {}
}
],
"computed_at": "2023-11-07T05:31:56Z",
"status": "completed"
}Authorizations
API key authentication. Send your API key as: Authorization: Bearer <your_api_key>
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"⌘I