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).
| Field | Type | Required | Description |
|---|---|---|---|
payroll_run_id | integer | Yes | ID of the approved payroll run to generate GL postings for. |
target_system | string | No | 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: |
Example
{
"payroll_run_id": 14,
"target_system": "csv"
}
Responses
201 GL export batch created
Content type application/json, object · GlExportV1.
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | No | |
payroll_run_id | integer | No | |
target_system | string | No | |
status | string | No | Export generation status. One of: |
line_count | integer, nullable | No | Number of GL posting lines in the export. |
download_url | string, nullable | No | Signed temporary URL to download the export file (CSV or system-specific format). |
created_at | string (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"}'