openapi.json
FluxPayroll API
API for calculating gross-to-net payroll calculations across different countries. Currently supports Mexico with ISR, IMSS, INFONAVIT, and state-level payroll tax calculations.
Version: 2.0.0
Contact: FluxPayroll
Servers
- URL: https://api.staging.fluxpayroll.ai
Description: Staging
Paths
POST /api/mexico-payroll/calculate
- Summary: Calculate payroll (G2N)
- Description: Calculates gross-to-net payroll for an array of employees, including all Mexican taxes (ISR, IMSS, INFONAVIT). Returns detailed breakdown of employee and employer taxes for each employee.
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.
Request Body:
- Required: true
- Content:
- application/json:
- Schema: CalculatePayrollRequest
- Example:
{ "payrollConfig": { "startDate": "2026-01-01", "endDate": "2026-01-31", "period": "MONTHLY" }, "employees": [ { "employeeId": "emp-001", "employeeStartDate": "2020-01-01", "dailyWage": 3000, "earnings": [ { "earningCode": "SALARY", "amount": 91200 }, { "earningCode": "VACATION_PREMIUM", "amount": 3750 } ], "workAddress": { "state": "AGU" }, "workerRiskClass": "I" } ] }
- application/json:
Responses:
- 200:
- Description: Successful payroll calculation
- Content:
- application/json:
- Schema: CalculatePayrollResponse
- Example:
{ "results": [ { "employeeId": "emp-001", "grossPay": "94950.00", "employeeTaxes": { /* Taxes structure */ }, "employerTaxes": { /* Taxes structure */ }, "netPay": "71578.50", "dailySbc": "2828.50", "totalEmployeeTax": "21096.08", "totalEmployerTax": "2280.00" } ] }
- application/json:
- 400:
- Description: Invalid input data
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 401:
- Description: Unauthorized - Invalid or missing authentication token
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 500:
- Description: Internal server error during calculation
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 200:
POST /api/mexico-payroll/calculate-with-derived-earnings
- Summary: Calculate payroll (G2N) with auto-generated earnings
- Description: Calculates gross-to-net payroll by first generating earnings from time entries and compensation. Returns all Mexican taxes.
Available earnings can be obtained from the List Earnings.
- Request Body:
- Required: true
- Content:
- application/json:
- Responses:
- 200:
- Description: Successful payroll calculation with derived earnings
- Content:
- application/json:
- Schema: CalculatePayrollResponse
- application/json:
- 400:
- Description: Invalid input data
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 401:
- Description: Unauthorized - Invalid or missing authentication token
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 500:
- Description: Internal server error during calculation
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 200:
GET /api/mexico-payroll/earnings
Summary: Get all available earnings for Mexico
Description: Returns a list of all earning types available for Mexico payroll calculations.
Parameters:
- locale: Optional string (default: es-MX)
Responses:
- 200:
- Description: List of available earning types
- Content:
- application/json:
- Schema: Array of EarningResponse
- application/json:
- 400:
- Description: Unsupported locale
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 401:
- Description: Unauthorized - Invalid or missing authentication token
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 200:
GET /api/mexico-payroll/taxes
Summary: Get all taxes for Mexico
Description: Returns a list of all taxes for Mexico, including jurisdiction and agency details.
Responses:
- 200:
- Description: List of taxes retrieved successfully
- Content:
- application/json:
- Schema: Array of TaxResponse
- application/json:
- 400:
- Description: Unsupported locale
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 401:
- Description: Unauthorized - Invalid or missing authentication token
- Content:
- application/json:
- Schema: ErrorResponse
- application/json:
- 200:
Security
- apiKey: Required for all endpoints