Skip to content

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

postingLines.export: PostingExportRequest
FieldTypeRequiredDescription
target"xero" | "quickbooks" | "netsuite" | "ramp"YesAccounting platform the rows are projected to.
accounting_period_idstring (uuid)YesIdentifier of the accounting period.
{
  "target": "xero",
  "accounting_period_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Response 200: PostingExport

postingLines.export: PostingExport
FieldTypeRequiredDescription
target"xero" | "quickbooks" | "netsuite" | "ramp"YesAccounting platform the rows were projected to.
accounting_period_idstring (uuid)YesIdentifier of the accounting period exported.
filenamestringYesSuggested file name.Constraints: length 1 to 300
content_type"text/csv"YesMedia type.
headerarray of stringYesColumn names after the canon mapping.
row_countintegerYesPosting lines exported.Constraints: range 0 to any
csvstringYesRFC 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"}'