curl --request POST \
--url https://api.exowpee.com/v1/accounting/client/entry-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.exowpee.com/v1/accounting/client/entry-imports"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.exowpee.com/v1/accounting/client/entry-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/accounting/client/entry-imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/accounting/client/entry-imports"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/accounting/client/entry-imports")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/client/entry-imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner_type": "<string>",
"original_name": "<string>",
"row_count": 123,
"status": "<string>",
"error_count": 123,
"posted_journal_entry_ids": [
"<unknown>"
],
"rows": "<array>",
"created_by": "<string>",
"created_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Upload entries file for import (client account)
Uploads a CSV file of accounting entries and checks every row; nothing is posted yet (client space). Files with errors are marked rejected.
curl --request POST \
--url https://api.exowpee.com/v1/accounting/client/entry-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.exowpee.com/v1/accounting/client/entry-imports"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.exowpee.com/v1/accounting/client/entry-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/accounting/client/entry-imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/accounting/client/entry-imports"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/accounting/client/entry-imports")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/client/entry-imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner_type": "<string>",
"original_name": "<string>",
"row_count": 123,
"status": "<string>",
"error_count": 123,
"posted_journal_entry_ids": [
"<unknown>"
],
"rows": "<array>",
"created_by": "<string>",
"created_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}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.
- 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.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource 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.
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
CSV file of entries, with fields separated by semicolons. Required. At most 10 MB; the file name must end with .csv.
10240Response
Resource (only with response=resource).
Identifier of the import, a 27-character KSUID.
Kind of book the import belongs to (the organization's own books or a client account's books).
Name of the uploaded file as uploaded, shortened if too long.
Number of data rows read from the file, header excluded.
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.
Number of rows that have at least one error.
Identifiers of the journal entries posted from this import, in file order. Null until the import is posted.
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.
Identifier of the member or agent account that uploaded the file; null when no actor could be resolved.
Kind of actor in created_by (member or agent account); null when no actor could be resolved.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).