Saltar al contenido

Export posting lines

Módulo Finance

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`.

  • Requiere la capacidad finance.upl.export.
  • Alcances de OAuth: finance.
  • Envía el encabezado Idempotency-Key. Una repetición con la misma clave devuelve la respuesta original.
  • Estados de error: 400, 401, 409, 422, 429. Los errores son detalles de problema RFC 9457.

Cuerpo de la solicitud: PostingExportRequest

postingLines.export: PostingExportRequest
CampoTipoObligatorioDescripción
target"xero" | "quickbooks" | "netsuite" | "ramp"SíAccounting platform the rows are projected to.
accounting_period_idstring (uuid)SíIdentifier of the accounting period.
{
  "target": "xero",
  "accounting_period_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Respuesta 200: PostingExport

postingLines.export: PostingExport
CampoTipoObligatorioDescripción
target"xero" | "quickbooks" | "netsuite" | "ramp"SíAccounting platform the rows were projected to.
accounting_period_idstring (uuid)SíIdentifier of the accounting period exported.
filenamestringSíSuggested file name.Restricciones: length 1 to 300
content_type"text/csv"SíMedia type.
headerarray of stringSíColumn names after the canon mapping.
row_countintegerSíPosting lines exported.Restricciones: range 0 to any
csvstringSí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"
}

Ejemplos de código

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"}'