Skip to main content
POST
/
api
/
mexico-payroll
/
generate-earnings
Generate earnings from time entries and compensation
curl --request POST \
  --url https://api.staging.fluxpayroll.ai/api/mexico-payroll/generate-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": 15000
      },
      "timeEntries": [],
      "workAddress": {
        "state": "AGU"
      }
    }
  ],
  "payrollConfig": {
    "startDate": "2025-09-01",
    "endDate": "2025-09-30",
    "period": "MONTHLY"
  },
  "fillDefaultSchedule": false
}
'
{
  "results": [
    {
      "employeeId": "emp-001",
      "dailyWage": 500,
      "earnings": [
        {
          "earningCode": "SALARY",
          "amount": 15000
        }
      ]
    }
  ]
}

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
fillDefaultSchedule
boolean
default:false

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

Response

Successfully generated earnings

results
object[]
required

Array of generated earnings per employee