---
title: "Read payroll"
description: "Read payroll settings, runs (optionally of one frequency), one run with its receipt count and net per state, a run's receipts (optionally in one state), or one receipt with its lines and calculation."
language: en
canonical_url: "https://exac.mx/docs/en/mcp/tools/get_payroll"
md_url: "https://exac.mx/docs/en/mcp/tools/get_payroll.md"
---

# Read payroll

Read payroll settings, runs (optionally of one frequency), one run with its receipt count and net per state, a run's receipts (optionally in one state), or one receipt with its lines and calculation.

Tool: `get_payroll`

## Purpose

Read payroll settings, runs, and their receipts before preparing, adjusting, or stamping them.

### Use when

You need a run id, its ready count and net, or why a receipt needs attention.

### Do not use when

You need a stamped receipt as a CFDI; use get_document with its documentRef.

| Detail | Value |
| --- | --- |
| Permissions | employees:read |
| Side effects | None |
| Idempotency | Idempotent |

## Input schema

```json
{
  "type": "object",
  "properties": {
    "input": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "const": "settings"
            }
          },
          "required": [
            "operation"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "const": "runs"
            },
            "frequency": {
              "enum": [
                "10",
                "02",
                "03",
                "04",
                "05"
              ]
            },
            "cursor": {
              "$ref": "#/definitions/__schema0"
            },
            "limit": {
              "$ref": "#/definitions/__schema1"
            }
          },
          "required": [
            "operation"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "const": "run"
            },
            "runId": {
              "$ref": "#/definitions/__schema2"
            }
          },
          "required": [
            "operation",
            "runId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "const": "rows"
            },
            "runId": {
              "$ref": "#/definitions/__schema2"
            },
            "state": {
              "enum": [
                "ready",
                "needs_attention",
                "excluded",
                "queued",
                "stamping",
                "stamped",
                "rejected",
                "canceled"
              ]
            },
            "cursor": {
              "$ref": "#/definitions/__schema0"
            },
            "limit": {
              "$ref": "#/definitions/__schema1"
            }
          },
          "required": [
            "operation",
            "runId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "const": "row"
            },
            "rowId": {
              "type": "string",
              "minLength": 1,
              "description": "rowId of a receipt, as listed in its run's receipts."
            }
          },
          "required": [
            "operation",
            "rowId"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "input"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "definitions": {
    "__schema0": {
      "type": "string",
      "minLength": 1
    },
    "__schema1": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "__schema2": {
      "type": "string",
      "minLength": 1,
      "description": "runId of a payroll run, as prepared or listed."
    }
  }
}
```

## Output schema

```json
{
  "type": "object",
  "properties": {
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "minimumWageZone": {
              "enum": [
                "general",
                "northBorder"
              ]
            },
            "defaultRiskClass": {
              "type": "string"
            },
            "defaultStateCode": {
              "type": "string"
            },
            "weeklyStartsOn": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            },
            "biweeklyAnchorStart": {
              "type": "string",
              "allOf": [
                {
                  "type": "string",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "pattern": "^(19|20)"
                }
              ]
            },
            "suggestedMinimumWageZone": {
              "allOf": [
                {
                  "enum": [
                    "general",
                    "northBorder"
                  ]
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "runs": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/__schema2"
              }
            },
            "nextCursor": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "hasMore": {
              "type": "boolean"
            }
          },
          "required": [
            "runs",
            "nextCursor",
            "hasMore"
          ],
          "additionalProperties": false
        },
        {
          "$ref": "#/definitions/__schema2"
        },
        {
          "type": "object",
          "properties": {
            "rows": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "rowId": {
                    "$ref": "#/definitions/__schema5"
                  },
                  "runId": {
                    "$ref": "#/definitions/__schema6"
                  },
                  "employeeId": {
                    "$ref": "#/definitions/__schema7"
                  },
                  "employeeName": {
                    "$ref": "#/definitions/__schema8"
                  },
                  "employeeTaxId": {
                    "$ref": "#/definitions/__schema9"
                  },
                  "state": {
                    "$ref": "#/definitions/__schema11"
                  },
                  "omitted": {
                    "$ref": "#/definitions/__schema12"
                  },
                  "source": {
                    "$ref": "#/definitions/__schema13"
                  },
                  "issues": {
                    "$ref": "#/definitions/__schema14"
                  },
                  "paidDays": {
                    "$ref": "#/definitions/__schema15"
                  },
                  "totals": {
                    "$ref": "#/definitions/__schema16"
                  },
                  "documentRef": {
                    "$ref": "#/definitions/__schema17"
                  },
                  "uuid": {
                    "$ref": "#/definitions/__schema18"
                  },
                  "rejectionCode": {
                    "$ref": "#/definitions/__schema19"
                  },
                  "errorCode": {
                    "$ref": "#/definitions/__schema20"
                  },
                  "updatedAt": {
                    "$ref": "#/definitions/__schema4"
                  }
                },
                "required": [
                  "rowId",
                  "runId",
                  "employeeId",
                  "employeeName",
                  "state",
                  "omitted",
                  "source",
                  "issues",
                  "updatedAt"
                ],
                "additionalProperties": false
              }
            },
            "nextCursor": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "hasMore": {
              "type": "boolean"
            }
          },
          "required": [
            "rows",
            "nextCursor",
            "hasMore"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rowId": {
              "$ref": "#/definitions/__schema5"
            },
            "runId": {
              "$ref": "#/definitions/__schema6"
            },
            "employeeId": {
              "$ref": "#/definitions/__schema7"
            },
            "employeeName": {
              "$ref": "#/definitions/__schema8"
            },
            "employeeTaxId": {
              "$ref": "#/definitions/__schema9"
            },
            "state": {
              "$ref": "#/definitions/__schema11"
            },
            "omitted": {
              "$ref": "#/definitions/__schema12"
            },
            "source": {
              "$ref": "#/definitions/__schema13"
            },
            "issues": {
              "$ref": "#/definitions/__schema14"
            },
            "paidDays": {
              "$ref": "#/definitions/__schema15"
            },
            "totals": {
              "$ref": "#/definitions/__schema16"
            },
            "documentRef": {
              "$ref": "#/definitions/__schema17"
            },
            "uuid": {
              "$ref": "#/definitions/__schema18"
            },
            "rejectionCode": {
              "$ref": "#/definitions/__schema19"
            },
            "errorCode": {
              "$ref": "#/definitions/__schema20"
            },
            "updatedAt": {
              "$ref": "#/definitions/__schema4"
            },
            "earnings": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "$ref": "#/definitions/__schema21"
                  },
                  "code": {
                    "$ref": "#/definitions/__schema22"
                  },
                  "description": {
                    "$ref": "#/definitions/__schema23"
                  },
                  "taxableAmount": {
                    "type": "number"
                  },
                  "exemptAmount": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "code",
                  "taxableAmount",
                  "exemptAmount"
                ],
                "additionalProperties": false
              }
            },
            "deductions": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "$ref": "#/definitions/__schema21"
                  },
                  "code": {
                    "$ref": "#/definitions/__schema22"
                  },
                  "description": {
                    "$ref": "#/definitions/__schema23"
                  },
                  "amount": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "code",
                  "amount"
                ],
                "additionalProperties": false
              }
            },
            "otherPayments": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "$ref": "#/definitions/__schema21"
                  },
                  "code": {
                    "$ref": "#/definitions/__schema22"
                  },
                  "description": {
                    "$ref": "#/definitions/__schema23"
                  },
                  "amount": {
                    "type": "number"
                  },
                  "employmentSubsidy": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "code",
                  "amount"
                ],
                "additionalProperties": false
              }
            },
            "explanation": {
              "type": "object",
              "properties": {
                "paidDays": {
                  "type": "number"
                },
                "contributionDays": {
                  "type": "number"
                },
                "dailyWage": {
                  "type": "number"
                },
                "integratedDailySalary": {
                  "type": "number"
                },
                "contributionBaseSalary": {
                  "type": "number"
                },
                "isrCaused": {
                  "type": "number"
                },
                "lines": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "label",
                      "amount"
                    ],
                    "additionalProperties": false
                  }
                },
                "rules": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "legalBasis": {
                        "type": "string"
                      },
                      "readOn": {
                        "allOf": [
                          {
                            "$ref": "#/definitions/__schema0"
                          }
                        ]
                      },
                      "validFrom": {
                        "allOf": [
                          {
                            "$ref": "#/definitions/__schema0"
                          }
                        ]
                      },
                      "sourceUrl": {
                        "allOf": [
                          {
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "key",
                      "label",
                      "legalBasis",
                      "readOn",
                      "validFrom"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "paidDays",
                "contributionDays",
                "dailyWage",
                "integratedDailySalary",
                "contributionBaseSalary",
                "isrCaused",
                "lines",
                "rules"
              ],
              "additionalProperties": false
            },
            "lastReceiptSalaryAvailable": {
              "type": "boolean"
            }
          },
          "required": [
            "rowId",
            "runId",
            "employeeId",
            "employeeName",
            "state",
            "omitted",
            "source",
            "issues",
            "updatedAt",
            "earnings",
            "deductions",
            "otherPayments",
            "lastReceiptSalaryAvailable"
          ],
          "additionalProperties": false
        }
      ]
    },
    "error": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "code": {
          "enum": [
            "validation_error",
            "unauthenticated",
            "forbidden",
            "payment_required",
            "not_found",
            "method_not_allowed",
            "conflict",
            "idempotency_conflict",
            "operation_in_progress",
            "recovery_required",
            "migration_required",
            "rate_limited",
            "provider_unavailable",
            "internal"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "object",
          "properties": {
            "document": {
              "type": "object",
              "properties": {
                "documentRef": {
                  "type": "string",
                  "pattern": "^(invoice|withholding|sales_receipt|declaration|tax_compliance_opinion|sales_receipt_refund):.+$"
                },
                "editable": {
                  "type": "boolean"
                }
              },
              "required": [
                "documentRef",
                "editable"
              ],
              "additionalProperties": false
            },
            "issues": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    }
                  },
                  "message": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "path",
                  "message"
                ],
                "additionalProperties": false
              }
            },
            "retryable": {
              "type": "boolean"
            },
            "retryAfterSeconds": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "reason": {
              "type": "string"
            },
            "balanceMinor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "topUpUrl": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "definitions": {
    "__schema0": {
      "type": "string",
      "format": "date"
    },
    "__schema2": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string"
        },
        "frequency": {
          "enum": [
            "10",
            "02",
            "03",
            "04",
            "05"
          ]
        },
        "periodStart": {
          "$ref": "#/definitions/__schema0"
        },
        "periodEnd": {
          "$ref": "#/definitions/__schema0"
        },
        "paidOn": {
          "$ref": "#/definitions/__schema0"
        },
        "calculating": {
          "type": "boolean"
        },
        "rows": {
          "type": "object",
          "properties": {
            "ready": {
              "$ref": "#/definitions/__schema3"
            },
            "needs_attention": {
              "$ref": "#/definitions/__schema3"
            },
            "excluded": {
              "$ref": "#/definitions/__schema3"
            },
            "queued": {
              "$ref": "#/definitions/__schema3"
            },
            "stamping": {
              "$ref": "#/definitions/__schema3"
            },
            "stamped": {
              "$ref": "#/definitions/__schema3"
            },
            "rejected": {
              "$ref": "#/definitions/__schema3"
            },
            "canceled": {
              "$ref": "#/definitions/__schema3"
            }
          },
          "required": [
            "ready",
            "needs_attention",
            "excluded",
            "queued",
            "stamping",
            "stamped",
            "rejected",
            "canceled"
          ],
          "additionalProperties": false
        },
        "missingSalary": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAt": {
          "$ref": "#/definitions/__schema4"
        },
        "stampRequestedAt": {
          "allOf": [
            {
              "$ref": "#/definitions/__schema4"
            }
          ]
        },
        "stampBlock": {
          "type": "object",
          "properties": {
            "code": {
              "enum": [
                "payment_required",
                "interrupted",
                "rules_pending_review"
              ]
            }
          },
          "required": [
            "code"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "runId",
        "frequency",
        "periodStart",
        "periodEnd",
        "paidOn",
        "calculating",
        "rows",
        "missingSalary",
        "createdAt"
      ],
      "additionalProperties": false
    },
    "__schema3": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "net": {
          "type": "number"
        }
      },
      "required": [
        "count",
        "net"
      ],
      "additionalProperties": false
    },
    "__schema4": {
      "type": "string",
      "format": "date-time"
    },
    "__schema5": {
      "type": "string"
    },
    "__schema6": {
      "type": "string"
    },
    "__schema7": {
      "type": "string"
    },
    "__schema8": {
      "type": "string"
    },
    "__schema9": {
      "allOf": [
        {
          "type": "string"
        }
      ]
    },
    "__schema11": {
      "enum": [
        "ready",
        "needs_attention",
        "excluded",
        "queued",
        "stamping",
        "stamped",
        "rejected",
        "canceled"
      ]
    },
    "__schema12": {
      "type": "boolean"
    },
    "__schema13": {
      "enum": [
        "calculated",
        "manual"
      ]
    },
    "__schema14": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "enum": [
              "rfc_invalid",
              "tax_system_invalid",
              "postal_code_invalid",
              "curp_invalid",
              "employee_number_invalid",
              "contract_type_invalid",
              "regime_type_invalid",
              "payment_frequency_invalid",
              "unsupported_regime",
              "unsupported_contract",
              "unsupported_frequency",
              "state_code_missing",
              "social_security_number_missing",
              "employment_start_missing",
              "position_risk_missing",
              "integrated_daily_salary_missing",
              "bank_account_invalid",
              "job_title_invalid",
              "department_invalid",
              "work_schedule_type_invalid",
              "contribution_base_salary_invalid",
              "salary_missing",
              "salary_below_minimum_wage",
              "minimum_wage_zone_missing",
              "employer_rfc_missing",
              "employer_registration_missing",
              "employer_curp_missing",
              "invalid_salary",
              "not_employed_in_period",
              "sdi_below_daily_wage",
              "rules_unavailable",
              "negative_net",
              "employee_missing",
              "not_in_roster",
              "period_already_paid",
              "subsidy_line_invalid",
              "subsidy_ceiling_exceeded",
              "subsidy_month_cap_exceeded",
              "invalid_request",
              "amounts_changed",
              "stamp_failed",
              "stamp_unconfirmed"
            ]
          },
          "field": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "additionalProperties": false
      }
    },
    "__schema15": {
      "type": "number"
    },
    "__schema16": {
      "type": "object",
      "properties": {
        "gross": {
          "type": "number"
        },
        "deductions": {
          "type": "number"
        },
        "net": {
          "type": "number"
        },
        "isr": {
          "type": "number"
        },
        "subsidy": {
          "type": "number"
        },
        "imss": {
          "type": "number"
        }
      },
      "required": [
        "gross",
        "deductions",
        "net",
        "isr",
        "subsidy",
        "imss"
      ],
      "additionalProperties": false
    },
    "__schema17": {
      "type": "string"
    },
    "__schema18": {
      "type": "string"
    },
    "__schema19": {
      "type": "string"
    },
    "__schema20": {
      "enum": [
        "rfc_invalid",
        "tax_system_invalid",
        "postal_code_invalid",
        "curp_invalid",
        "employee_number_invalid",
        "contract_type_invalid",
        "regime_type_invalid",
        "payment_frequency_invalid",
        "unsupported_regime",
        "unsupported_contract",
        "unsupported_frequency",
        "state_code_missing",
        "social_security_number_missing",
        "employment_start_missing",
        "position_risk_missing",
        "integrated_daily_salary_missing",
        "bank_account_invalid",
        "job_title_invalid",
        "department_invalid",
        "work_schedule_type_invalid",
        "contribution_base_salary_invalid",
        "salary_missing",
        "salary_below_minimum_wage",
        "minimum_wage_zone_missing",
        "employer_rfc_missing",
        "employer_registration_missing",
        "employer_curp_missing",
        "invalid_salary",
        "not_employed_in_period",
        "sdi_below_daily_wage",
        "rules_unavailable",
        "negative_net",
        "employee_missing",
        "not_in_roster",
        "period_already_paid",
        "subsidy_line_invalid",
        "subsidy_ceiling_exceeded",
        "subsidy_month_cap_exceeded",
        "invalid_request",
        "amounts_changed",
        "stamp_failed",
        "stamp_unconfirmed"
      ]
    },
    "__schema21": {
      "type": "string"
    },
    "__schema22": {
      "type": "string"
    },
    "__schema23": {
      "type": "string"
    }
  },
  "oneOf": [
    {
      "required": [
        "data"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}
```

## Related tools

- [`save_payroll`](/docs/en/mcp/tools/save_payroll.md) — **Save payroll**: Prepare or adjust payroll before stamping: change payroll settings (only the fields sent change; null clears one), prepare the run of a pay period (idempotent per period; receipts calculate in the background), change its payment date, recalculate it, or update one receipt (omit or include it, capture its amounts, or return it to the calculation), or prepare a canceled receipt again.

- [`stamp_payroll`](/docs/en/mcp/tools/stamp_payroll.md) — **Stamp payroll**: Irreversibly stamp payroll receipts. stamp_run queues every ready receipt of a run; send the ready count and net you checked with get_payroll, and a difference stamps nothing. restamp_row stamps a rejected receipt again after its employee was corrected. Receipts stamp in the background, each on its own; follow them with get_payroll. Safe retries require reusing the same idempotencyKey.

- [`get_employees`](/docs/en/mcp/tools/get_employees.md) — **Read employees**: Search payroll employees or retrieve one employee. Search matches name, RFC, CURP, employee number, job title, or department.

## Related workflow

[See the canonical workflows in Quickstart](/docs/en.md)

## Equivalent REST operations

- [`GET /v1/payroll/settings`](/docs/en/api/documents/payroll/get-payroll-settings.md)

- [`GET /v1/payroll/runs`](/docs/en/api/documents/payroll/list-payroll-runs.md)

- [`GET /v1/payroll/runs/{runId}`](/docs/en/api/documents/payroll/get-payroll-run.md)

- [`GET /v1/payroll/runs/{runId}/rows`](/docs/en/api/documents/payroll/list-payroll-rows.md)

- [`GET /v1/payroll/rows/{rowId}`](/docs/en/api/documents/payroll/get-payroll-row.md)

Complete documentation: https://exac.mx/docs/en.md
Agent documentation index: https://exac.mx/docs/en/llms.txt
