Skip to content

Generate payroll GL export

POST/payroll/gl-exports

Generates a general ledger (GL) export batch for a payroll run, mapping payroll components (salaries, taxes, allowances, deductions) to the configured chart-of-accounts codes. The export can target CSV, or a connected accounting system (QuickBooks, Xero, etc.).

Request

Request body

Content type application/json (required).

FieldTypeRequiredDescription
payroll_run_idintegerYes

ID of the approved payroll run to generate GL postings for.

target_systemstringNo

Target accounting system for the export. "csv" — generic comma-separated values download. Other values map to configured accounting connector integrations (e.g. "xero", "quickbooks").

Default: "csv"

Example

{
  "payroll_run_id": 14,
  "target_system": "csv"
}

Responses

201 GL export batch created

Content type application/json, object · GlExportV1.

FieldTypeRequiredDescription
idintegerNo
payroll_run_idintegerNo
target_systemstringNo
statusstringNo

Export generation status.

One of: "generating", "ready", "failed"

line_countinteger, nullableNo

Number of GL posting lines in the export.

download_urlstring, nullableNo

Signed temporary URL to download the export file (CSV or system-specific format).

created_atstring (date-time)No

Example

{
  "id": 7,
  "payroll_run_id": 14,
  "target_system": "csv",
  "status": "ready",
  "line_count": 148,
  "download_url": "https://cdn.faciotech.net/gl-exports/7/export.csv?token=abc123",
  "created_at": "2026-04-08T15:00:00Z"
}

422 Validation failed — check payroll_run_id or target_system value

Example request

curl -X POST "https://{tenant}.faciotech.net/api/v1/payroll/gl-exports" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"payroll_run_id": 14, "target_system": "csv"}'
Loading