Skip to main content
POST
/
api
/
mexico-payroll
/
calculate-with-derived-earnings
Calculate payroll (G2N) with auto-generated earnings
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"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Body

application/json
employees
object[]
required

Array of employees with time entries and compensation

Minimum array length: 1
payrollConfig
object
required
Example:
{
"startDate": "2026-01-01",
"endDate": "2026-01-31",
"period": "MONTHLY"
}
fillDefaultSchedule
boolean
default:true

When true, auto-fills default time entries (standard work hours) for work days missing from employee timeEntries

Response

Successful payroll calculation with derived earnings

results
object[]
required

Array of payroll results, one per employee