curl --request POST \
--url https://api.staging.fluxpayroll.ai/api/mexico-payroll/calculate-with-derived-earnings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"employees": [
{
"employeeId": "emp-001",
"employeeStartDate": "2020-01-01",
"compensation": {
"type": "MONTHLY",
"amount": 50000
},
"timeEntries": [],
"previousBimesterEarnigs": [],
"workAddress": {
"state": "AGU"
},
"earnings": [],
"workerRiskClass": "I"
}
],
"payrollConfig": {
"startDate": "2026-01-01",
"endDate": "2026-01-31",
"period": "MONTHLY"
},
"fillDefaultSchedule": true
}
'{
"results": [
{
"employeeId": "emp-001",
"grossPay": "50000.00",
"employeeTaxes": {
"MX_IMSS_DISEASE_MATERNITY_PENSIONERS_EE": {
"wageBase": "51241.80",
"taxAmount": "192.16",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISEASE_MATERNITY_KIND_EE": {
"wageBase": "51241.80",
"taxAmount": "164.92",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISEASE_MATERNITY_MONEY_EE": {
"wageBase": "51241.80",
"taxAmount": "128.10",
"taxType": "CONTRIBUTIONS"
},
"MX_SAT_ISR": {
"wageBase": "50000.00",
"taxAmount": "9107.82",
"taxType": "TAX",
"wageBaseContributions": {
"SALARY": {
"earningKey": "SALARY",
"grossAmount": "50000.00",
"exemptionAmount": "0.00",
"taxableAmount": "50000.00"
},
"SOCIAL_WELFARE_BENEFITS": {
"earningKey": "SOCIAL_WELFARE_BENEFITS",
"grossAmount": "0.00",
"exemptionAmount": "0.00",
"taxableAmount": "0.00"
}
}
},
"MX_IMSS_DISABILITY_LIFE_EE": {
"wageBase": "51241.80",
"taxAmount": "320.26",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_RETIREMENT_ADVANCED_AGE_EE": {
"wageBase": "51241.80",
"taxAmount": "576.47",
"taxType": "CONTRIBUTIONS"
}
},
"employerTaxes": {
"MX_IMSS_DISEASE_MATERNITY_KIND_ER": {
"wageBase": "51241.80",
"taxAmount": "1134.40",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_WORK_RISK": {
"wageBase": "51241.80",
"taxAmount": "278.52",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_RETIREMENT_OLD_AGE_ER": {
"wageBase": "51241.80",
"taxAmount": "1024.84",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_RETIREMENT_ADVANCED_AGE_ER": {
"wageBase": "51241.80",
"taxAmount": "3290.75",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISEASE_MATERNITY_PENSIONERS_ER": {
"wageBase": "51241.80",
"taxAmount": "538.04",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISEASE_MATERNITY_MONEY_ER": {
"wageBase": "51241.80",
"taxAmount": "358.69",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISABILITY_LIFE_ER": {
"wageBase": "51241.80",
"taxAmount": "896.73",
"taxType": "CONTRIBUTIONS"
},
"MX_INFONAVIT_HOUSING": {
"wageBase": "51241.80",
"taxAmount": "2562.09",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_NURSERY_SOCIAL_BENEFITS": {
"wageBase": "51241.80",
"taxAmount": "512.42",
"taxType": "CONTRIBUTIONS"
},
"MX_AGU_PAYROLL": {
"wageBase": "50000.00",
"taxAmount": "1250.00",
"taxType": "TAX",
"wageBaseContributions": {
"SALARY": {
"earningKey": "SALARY",
"grossAmount": "50000.00",
"exemptionAmount": "0.00",
"taxableAmount": "50000.00"
},
"TERMINATION_COMPENSATION": {
"earningKey": "TERMINATION_COMPENSATION",
"grossAmount": "0.00",
"exemptionAmount": "0.00",
"taxableAmount": "0.00"
}
}
}
},
"totalEmployerTaxes": "11846.48",
"totalEmployeeTaxes": "10489.73",
"netPay": "39510.27",
"dailySbc": "1737.01",
"totalEmployeeTax": "9107.82",
"totalEmployeeContributions": "1381.91",
"totalEmployerTax": "1250.00",
"totalEmployerContributions": "10596.48"
}
]
}Calculates gross-to-net payroll by first generating earnings from time entries and compensation, then calculating all Mexican taxes. This endpoint accepts time entries (start/end times per day) and compensation (daily/weekly/monthly/annual) and automatically derives earnings like SALARY, DOUBLE_OVERTIME, and TRIPLE_OVERTIME.
Available earnings can be obtained from the List Earnings endpoint. The response includes taxes and social security contributions — see List Taxes and List Social Security Contributions for details.
curl --request POST \
--url https://api.staging.fluxpayroll.ai/api/mexico-payroll/calculate-with-derived-earnings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"employees": [
{
"employeeId": "emp-001",
"employeeStartDate": "2020-01-01",
"compensation": {
"type": "MONTHLY",
"amount": 50000
},
"timeEntries": [],
"previousBimesterEarnigs": [],
"workAddress": {
"state": "AGU"
},
"earnings": [],
"workerRiskClass": "I"
}
],
"payrollConfig": {
"startDate": "2026-01-01",
"endDate": "2026-01-31",
"period": "MONTHLY"
},
"fillDefaultSchedule": true
}
'{
"results": [
{
"employeeId": "emp-001",
"grossPay": "50000.00",
"employeeTaxes": {
"MX_IMSS_DISEASE_MATERNITY_PENSIONERS_EE": {
"wageBase": "51241.80",
"taxAmount": "192.16",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISEASE_MATERNITY_KIND_EE": {
"wageBase": "51241.80",
"taxAmount": "164.92",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISEASE_MATERNITY_MONEY_EE": {
"wageBase": "51241.80",
"taxAmount": "128.10",
"taxType": "CONTRIBUTIONS"
},
"MX_SAT_ISR": {
"wageBase": "50000.00",
"taxAmount": "9107.82",
"taxType": "TAX",
"wageBaseContributions": {
"SALARY": {
"earningKey": "SALARY",
"grossAmount": "50000.00",
"exemptionAmount": "0.00",
"taxableAmount": "50000.00"
},
"SOCIAL_WELFARE_BENEFITS": {
"earningKey": "SOCIAL_WELFARE_BENEFITS",
"grossAmount": "0.00",
"exemptionAmount": "0.00",
"taxableAmount": "0.00"
}
}
},
"MX_IMSS_DISABILITY_LIFE_EE": {
"wageBase": "51241.80",
"taxAmount": "320.26",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_RETIREMENT_ADVANCED_AGE_EE": {
"wageBase": "51241.80",
"taxAmount": "576.47",
"taxType": "CONTRIBUTIONS"
}
},
"employerTaxes": {
"MX_IMSS_DISEASE_MATERNITY_KIND_ER": {
"wageBase": "51241.80",
"taxAmount": "1134.40",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_WORK_RISK": {
"wageBase": "51241.80",
"taxAmount": "278.52",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_RETIREMENT_OLD_AGE_ER": {
"wageBase": "51241.80",
"taxAmount": "1024.84",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_RETIREMENT_ADVANCED_AGE_ER": {
"wageBase": "51241.80",
"taxAmount": "3290.75",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISEASE_MATERNITY_PENSIONERS_ER": {
"wageBase": "51241.80",
"taxAmount": "538.04",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISEASE_MATERNITY_MONEY_ER": {
"wageBase": "51241.80",
"taxAmount": "358.69",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_DISABILITY_LIFE_ER": {
"wageBase": "51241.80",
"taxAmount": "896.73",
"taxType": "CONTRIBUTIONS"
},
"MX_INFONAVIT_HOUSING": {
"wageBase": "51241.80",
"taxAmount": "2562.09",
"taxType": "CONTRIBUTIONS"
},
"MX_IMSS_NURSERY_SOCIAL_BENEFITS": {
"wageBase": "51241.80",
"taxAmount": "512.42",
"taxType": "CONTRIBUTIONS"
},
"MX_AGU_PAYROLL": {
"wageBase": "50000.00",
"taxAmount": "1250.00",
"taxType": "TAX",
"wageBaseContributions": {
"SALARY": {
"earningKey": "SALARY",
"grossAmount": "50000.00",
"exemptionAmount": "0.00",
"taxableAmount": "50000.00"
},
"TERMINATION_COMPENSATION": {
"earningKey": "TERMINATION_COMPENSATION",
"grossAmount": "0.00",
"exemptionAmount": "0.00",
"taxableAmount": "0.00"
}
}
}
},
"totalEmployerTaxes": "11846.48",
"totalEmployeeTaxes": "10489.73",
"netPay": "39510.27",
"dailySbc": "1737.01",
"totalEmployeeTax": "9107.82",
"totalEmployeeContributions": "1381.91",
"totalEmployerTax": "1250.00",
"totalEmployerContributions": "10596.48"
}
]
}Array of employees with time entries and compensation
1Show child attributes
Show child attributes
{
"startDate": "2026-01-01",
"endDate": "2026-01-31",
"period": "MONTHLY"
}When true, auto-fills default time entries (standard work hours) for work days missing from employee timeEntries
Successful payroll calculation with derived earnings
Array of payroll results, one per employee
Show child attributes