Skip to main content

Payroll Run CSV Export API

Summary

One native operation exports run details as an in-memory CSV attachment.

Audience

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

Reference Content

Authentication: bearer context is expected for business APIs; service-local enforcement Requires confirmation. Authorization: no endpoint-specific Payroll Service role policy is confirmed. Maturity: Direct / Shadow.

OperationMethod and public routePurposeAuthenticationTenant contextRequest typeResponse typeSuccessMaturitySource path
Export Payroll run CSVGET /payroll/runs/{runId:guid}/exportDownload a general Payroll run CSV.Bearer context expected; service-local enforcement Requires confirmationForwarded or explicit tenant context; exact missing-context mapping Requires confirmationRoute and query parametersCSV file (text/csv)200Directmicroservices/src/payroll-service/Api/PayrollOutputEndpoints.cs

Export Payroll run CSV

  • API family / maturity: Payroll Run CSV Export API; Direct
  • Authentication / authorization: Bearer context expected; service-local enforcement Requires confirmation. No endpoint-specific role policy is confirmed.
  • Tenant context: Forwarded or explicit tenant context; exact missing-context mapping Requires confirmation.
  • Route parameters: Required GUID runId.
  • Query parameters: Optional tenantId.
  • Request body / type: None; Route and query parameters.
  • Validation: Only checks stated in the error mapping below are confirmed; model-binding failures are framework behavior and not specified as a stable contract.
  • Response body / type: CSV file (text/csv).
  • Success / error responses: 200; 404 {message} when the run does not exist.
  • Business behavior: Download a general Payroll run CSV.
  • State and input implications: Read-only. No input projection changes.
  • Audit and event implications: Persists an export audit row. No event produced.
  • Compatibility notes: Native Payroll contract.
  • Safe example: GET /payroll/runs/{runId:guid}/export200 CSV attachment; missing run → 404 {"message":"Payroll run not found."}
  • Example error: {"message":"Request could not be completed."} (illustrative safe wording)

Family-level findings

Unlike bank export, source does not require Frozen state. The file contains Payroll outcome categories and is sensitive. No paging, asynchronous job, stored artifact, encryption, or retention contract is exposed.

Source References

  • microservices/src/payroll-service/Api/PayrollOutputEndpoints.cs
  • microservices/src/payroll-service/Application/PayrollOutputsService.cs

See Also

Keywords

  • Payroll API
  • Payroll Run CSV Export API

Revision Information

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