POST
Upload entries file for import (client account)
Client space Accounting module For: Accountant · Permission: entry_imports.create Conditions
  • The book is the one selected for the request: the {book} segment in the organization space, or the client account’s own books in the client space.
  • The accounting module must be included in the plan of the organization.
  • The book must be set up for accounting (it must have at least one journal).
  • file is required: a CSV file of at most 10 MB whose name ends in .csv.
  • The file is read as semicolon-separated values (a leading byte order mark is ignored). It must have a header row with every required column (journalcode, journallib, ecriturenum, ecrituredate, comptenum, comptelib, compauxnum, compauxlib, pieceref, ecriturelib, debit, credit, ecriturelet, datelet, validdate, montantdevise, idevise), no unknown or duplicated column, and the two analytic columns together or not at all.
  • The file must hold at least one data row and at most 2000, and each row must have as many cells as the header.
  • A row that fails a check (missing entry number or reference, invalid date, date outside an open fiscal period of an existing fiscal year, unknown journal or account, non-postable account, balance-sheet-only rule of the opening journal, period already covered by a VAT declaration for VAT accounts, amount that is not exactly one positive debit or credit, unknown analytic axis or section, analytic split on an account outside income statement classes, or entry rows that differ in date or journal or do not balance) does not refuse the call: the import is stored as rejected with the errors recorded per row.
What else happens
  • Stores the uploaded file on the accounting attachments disk and creates the import with its rows.
  • Sets the import to validated when no row has an error, or to rejected with error_count when some do. No accounting entry is posted.
Part of Import entries from a file.

Authorizations

Authorization
string
header
required

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

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, original_name, row_count, status, error_count, posted_journal_entry_ids, created_by, created_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: rows.

Body

multipart/form-data
file
file
required

CSV file of entries, with fields separated by semicolons. Required. At most 10 MB; the file name must end with .csv.

Maximum string length: 10240

Response

Resource (only with response=resource).

id

Identifier of the import, a 27-character KSUID.

owner_type

Kind of book the import belongs to (the organization's own books or a client account's books).

original_name

Name of the uploaded file as uploaded, shortened if too long.

row_count
integer

Number of data rows read from the file, header excluded.

status

Import state: staged (being created), validated (no row error, ready to post), rejected (at least one row error, cannot be posted) or posted (entries written). Set by the server.

error_count
integer

Number of rows that have at least one error.

posted_journal_entry_ids
any[] | null

Identifiers of the journal entries posted from this import, in file order. Null until the import is posted.

rows
array

Rows of the file with their raw values and errors. Returned only with ?include=rows, on the show route and when the caller holds the entry_imports.retrieve permission.

created_by

Identifier of the member or agent account that uploaded the file; null when no actor could be resolved.

created_by_type

Kind of actor in created_by (member or agent account); null when no actor could 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).