{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/workday-payroll/refs/heads/main/json-schema/payroll-results-pay-run-result-schema.json",
  "title": "PayRunResult",
  "description": "PayRunResult schema from Workday Payroll Results API",
  "type": "object",
  "properties": {
    "payRunId": {
      "type": "string",
      "description": "Associated pay run identifier",
      "example": "pr_20260430_weekly_001"
    },
    "payPeriod": {
      "$ref": "#/$defs/PayPeriod"
    },
    "paymentDate": {
      "type": "string",
      "format": "date",
      "description": "Payment date",
      "example": "2026-04-30"
    },
    "totalGrossPay": {
      "type": "number",
      "format": "double",
      "description": "Aggregate gross pay",
      "example": 245830.5
    },
    "totalNetPay": {
      "type": "number",
      "format": "double",
      "description": "Aggregate net pay",
      "example": 178452.3
    },
    "totalDeductions": {
      "type": "number",
      "format": "double",
      "description": "Aggregate deductions",
      "example": 38210.8
    },
    "totalEmployerTaxes": {
      "type": "number",
      "format": "double",
      "description": "Total employer tax obligations",
      "example": 14583.7
    },
    "totalEmployeeTaxes": {
      "type": "number",
      "format": "double",
      "description": "Total employee tax withholdings",
      "example": 14583.7
    },
    "workerCount": {
      "type": "integer",
      "description": "Number of workers processed",
      "example": 87
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217 currency code",
      "example": "USD"
    }
  },
  "$defs": {
    "PayPeriod": {
      "type": "object",
      "properties": {
        "startDate": {
          "type": "string",
          "format": "date",
          "description": "Start date of the pay period",
          "example": "2026-04-30"
        },
        "endDate": {
          "type": "string",
          "format": "date",
          "description": "End date of the pay period",
          "example": "2026-04-30"
        }
      }
    }
  }
}
