Export posting lines
Finance module
POST/posting-lines/exportspostingLines.export
Projects the period's Universal Posting Lines to the target accounting platform through its canon field mapping and returns the CSV. There is no other export format. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.
- Requires the capability finance.upl.export.
- OAuth scopes: finance.
- Send an Idempotency-Key header. A replay with the same key returns the original response.
- Error statuses: 400, 401, 409, 422, 429. Errors are RFC 9457 problem details.
Request body: PostingExportRequest
| Field | Type | Required | Description |
|---|---|---|---|
| target | "xero" | "quickbooks" | "netsuite" | "ramp" | Yes | Accounting platform the rows are projected to. |
| accounting_period_id | string (uuid) | Yes | Identifier of the accounting period. |
{
"target": "xero",
"accounting_period_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}Response 200: PostingExport
| Field | Type | Required | Description |
|---|---|---|---|
| target | "xero" | "quickbooks" | "netsuite" | "ramp" | Yes | Accounting platform the rows were projected to. |
| accounting_period_id | string (uuid) | Yes | Identifier of the accounting period exported. |
| filename | string | Yes | Suggested file name.Constraints: length 1 to 300 |
| content_type | "text/csv" | Yes | Media type. |
| header | array of string | Yes | Column names after the canon mapping. |
| row_count | integer | Yes | Posting lines exported.Constraints: range 0 to any |
| csv | string | Yes | RFC 4180 CSV with CRLF line endings: the header, then one row per line. |
{
"target": "xero",
"accounting_period_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
"filename": "upl-xero-2026-09-01-2026-09-30.csv",
"content_type": "text/csv",
"header": [
"Date",
"Amount"
],
"row_count": 42,
"csv": "Date,AccountCode\r\n2026-09-14,5400\r\n"
}Code samples
curl -X POST "$XOS_BASE_URL/posting-lines/exports" \
-H "Authorization: Bearer $XOS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"target":"xero","accounting_period_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}'const { data } = await xos.postingLines.export({
"target": "xero",
"accounting_period_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
});response = xos.posting_lines.export({"target": "xero", "accounting_period_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"})xos posting-lines export --data '{"target":"xero","accounting_period_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}'