Upload a statement file
curl --request POST \
--url https://api.synci.io/api/v1/finance/accounts/{accountId}/imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.synci.io/api/v1/finance/accounts/{accountId}/imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.synci.io/api/v1/finance/accounts/{accountId}/imports"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.synci.io/api/v1/finance/accounts/{accountId}/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.synci.io/api/v1/finance/accounts/{accountId}/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))
}{
"message": "File parsed. Review the rows and commit the import.",
"data": {
"id": "<string>",
"financial_account_id": "<string>",
"format": "<string>",
"filename": "<string>",
"status": "<string>",
"row_count": 123,
"imported_count": 123,
"duplicate_count": 123,
"skipped_count": 123,
"date_from": "<string>",
"date_to": "<string>",
"closing_balance": "<string>",
"closing_balance_date": "<string>",
"balance_result": "<string>",
"balance_adjustment": {
"amount": "<string>",
"transaction_id": "<string>"
},
"mapping": "<string>",
"mapping_source": "<string>",
"error": "<string>",
"created_at": "<string>",
"committed_at": "<string>",
"expires_at": "<string>",
"preview": {}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Upload a statement file
Detects the format (camt.053, OFX/QFX or CSV), parses the file, checks every row against the account for
duplicates and returns the batch in PENDING_REVIEW with a preview. A CSV is read with the account’s saved
mapping when it has one, otherwise with a proposed mapping and a confidence per column; adjust it with the
mapping endpoint. Nothing is written until the batch is committed. The same file uploaded twice into one
account is a 409 with code: duplicate_import_file and the earlier batch’s id. Files over 10 MB or 20,000
rows, and files Synci cannot read, are a 422.
POST
/
finance
/
accounts
/
{accountId}
/
imports
Upload a statement file
curl --request POST \
--url https://api.synci.io/api/v1/finance/accounts/{accountId}/imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.synci.io/api/v1/finance/accounts/{accountId}/imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.synci.io/api/v1/finance/accounts/{accountId}/imports"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.synci.io/api/v1/finance/accounts/{accountId}/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.synci.io/api/v1/finance/accounts/{accountId}/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))
}{
"message": "File parsed. Review the rows and commit the import.",
"data": {
"id": "<string>",
"financial_account_id": "<string>",
"format": "<string>",
"filename": "<string>",
"status": "<string>",
"row_count": 123,
"imported_count": 123,
"duplicate_count": 123,
"skipped_count": 123,
"date_from": "<string>",
"date_to": "<string>",
"closing_balance": "<string>",
"closing_balance_date": "<string>",
"balance_result": "<string>",
"balance_adjustment": {
"amount": "<string>",
"transaction_id": "<string>"
},
"mapping": "<string>",
"mapping_source": "<string>",
"error": "<string>",
"created_at": "<string>",
"committed_at": "<string>",
"expires_at": "<string>",
"preview": {}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
oauth2http
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The financial account ID
Body
multipart/form-data
The statement file: camt.053 (XML), OFX/QFX or CSV, at most 10 MB.