Skip to main content

Payroll API Response and Error Model

Summary​

Native, compatibility, file, and foundation operations use different response conventions; there is no universal Payroll response envelope or RFC Problem Details contract.

Audience​

Frontend and backend developers, QA and support engineers, architects, security reviewers, and implementation partners.

Reference Content​

OutcomeNative run/output behaviorCompatibility behavior
SuccessUsually 200 with plain DTO/array; file endpoints return attachment bytes200 with bare object, array, file, or raw string
Invalid period/requestCalculation maps 400 {message}Guarded operations map 400 raw text
Not foundSelected operations map 404, sometimes empty and sometimes {message}Selected operations map 404 empty or raw text
Invalid lifecycle/conflictNative calculation/output commands map 409 {message}Guarded lifecycle operations generally map 400 raw text
Missing AttendanceEmployee is skipped during calculation; no dedicated HTTP errorSame native engine behavior when invoked
Recovery failureFreeze maps 409Guarded compatibility operations map 400
Payslip/export ineligibleNative frozen-only operations map 409Compatibility frozen lookup generally maps 404 raw text
Missing tenantNo consistent mapped response confirmedNo consistent mapped response confirmed
Unauthorized/forbiddenDeployment-level behavior Requires confirmationDeployment-level behavior Requires confirmation
External dependency/unhandled failureFramework-level response; public body not specifiedFramework-level response; public body not specified

Only the root service-information operation uses ApiResponse<ServiceInfoResponse>. The API does not configure Problem Details as its contract. Error text is implementation-facing and clients should branch on confirmed status codes rather than parse message wording.

Source References​

  • microservices/src/payroll-service/Api/PayrollRunEndpoints.cs
  • microservices/src/payroll-service/Api/PayrollOutputEndpoints.cs
  • microservices/src/payroll-service/Api/PayrollCompatEndpoints.cs
  • microservices/src/payroll-service/Program.cs
  • microservices/src/shared-kernel/Extensions/EndpointRouteBuilderExtensions.cs

See Also​

Keywords​

  • Payroll API
  • Payroll API Response and Error Model

Revision Information​

  • Status: Draft
  • Last reviewed: 2026-07-15
  • Review cycle: Quarterly