POST
Generate an accounting export (organization)
Organization space Accounting module For: Accountant · Permission: accounting_exports.create, the permission for the chosen export content Conditions
  • The accounting module must be part of the organization’s plan.
  • In the organization space, the caller must have access to the book.
  • The book must have accounting set up.
  • The chosen content also needs a permission: journal_entries.export for fec, statement_filings.export for liasse.
  • kind must be fec or liasse; fiscal_year_id is required and must be a fiscal year of the book.
  • params may only contain journal_id, from and to; journal_id must be a journal of the book, and to must not be before from.
  • For a liasse export, the fiscal year must have a filed annual statements filing of the normal system; otherwise the call is refused with a business-rule error. params are ignored for liasse.
What else happens
  • Generates the file now and stores it once, privately, under a random name.
  • Records the export with its file name, MIME type, size in bytes, generation time and the member or agent account who generated it.
  • For fec, writes the book’s journal lines as a CSV in the audit-file layout (every entry status, reversals included); for liasse, renders the filed annual statements to PDF from their frozen payload.
  • If saving the record fails, the stored file is deleted again.
Part of Export and share accounting files.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

book
string
required

Identifier of the accounting book in the organization space: the organization itself or one of its companies, among the books the caller has access to.

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, owner_type, kind, fiscal_year_id, params, original_name, mime_type, size, generated_at, generated_by, generated_by_type, created_at, updated_at.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: .

Body

application/json

The fiscal year and the journal must belong to the selected book: ids of another book fail validation.

kind
enum<string>
required

Kind of export: fec (journal entries CSV in the audit-file layout) or liasse (PDF of the filed annual statements; the fiscal year must have a filed normal-system filing). Required.

Available options:
fec,
liasse
fiscal_year_id
string
required

Fiscal year to export (27-character KSUID string). Required; it must belong to the selected book.

params
object

Optional filters for a fec export; only journal_id, from and to are accepted, and they are ignored for liasse.

Response

Resource (only with response=resource).

id

Identifier of the stored export (27-character KSUID string).

owner_type

Kind of book that owns the export: organization, company or client account.

kind

Kind of file: fec is the journal entries CSV in the audit-file layout; liasse is the PDF of the filed annual statements.

fiscal_year_id

Fiscal year the export covers (27-character KSUID string).

params

Filters sent when the file was generated: journal_id, from and to. They are stored as sent but only used for a fec export; a liasse export ignores them.

original_name

File name offered when the file is downloaded.

mime_type

Content type of the file: text/csv; charset=UTF-8 for fec, application/pdf for liasse.

size
integer

Size of the stored file in bytes.

generated_at

Date and time the file was generated (ISO 8601).

generated_by

Identifier of the member or agent account who generated the file; null when the actor could not be resolved.

generated_by_type

Type of the actor who generated the file (its morph alias); null when the actor could not be resolved.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).