Toshl Developer

Bank import

Import endpoint can be used to import export files from other banking insitutions.

Currently imports are supported in formats QIF, OFX, CSV, TAB, XLS. For other formats the API will return 400 Bad Request.

In case of CSV, TAB and XLS the import process cannot be completed without input from the user. Specifically we might not be able to figure out which columns link to which specific type (account, tags etc.). In that case the API will return an import object with the status = hints. It will also return a preview object so the users can match fields to types.

Sometimes we are also unable to automatically figure out which date format is being used. In that case status = date_formats is returned along with a formats object so users can select the appropriate format.

Resource representation

{
  "id": "42",
  "account": "42",
  "modified": "2016-11-11 10:28:10.435",
  "status": "completed",
  "preview": [
    {
      "hints": [
        "date",
        "skip",
        "skip",
        "description",
        "skip",
        "skip",
        "skip",
        "amount",
        "currency"
      ],
      "header": [
        "Date",
        "Value date",
        "Category",
        "Name",
        "Purpose",
        "Account",
        "Bank",
        "Amount",
        "Currency"
      ],
      "rows": [
        [
          "29.7.16",
          "29.7.16",
          "Cleared",
          "Some media",
          "Referenz Mandat Umkbw 007",
          "67832617867832671832",
          "GHJREWZU",
          "-47,89",
          "EUR"
        ],
        [
          "15.7.16",
          "15.7.16",
          "Cleared",
          "International SE",
          "Referenz Mandat 008 Einreicher-ID",
          "6786321678673821321",
          "JKLDSAOPW",
          "-16,00",
          "EUR"
        ],
        [
          "14.7.16",
          "14.7.16",
          "Cleared",
          "Steuerverwaltung NRW",
          "Referenz Verwendungszweck StNr 009",
          "637890321921244321",
          "HJKLDSAI",
          "263,38",
          "EUR"
        ]
      ]
    }
  ],
  "metadata": {
    "expenses": 2,
    "incomes": 1,
    "from": "2016-07-14",
    "to": "2016-07-29"
  },
  "formats": {
    "available": [
      "d/M/y",
      "y/M/d"
    ],
    "selected": "d/M/y",
    "examples": [
      "29.7.16",
      "15.7.16",
      "14.7.16"
    ]
  },
  "filename": "import.csv"
}

Properties

id
readonly
string

Import id.

account
read, write
string

Account id the data was imported to

modified
readonly
string

Specifies when the import was last modified.

status
readonly
string

Import status. hints is used for CSV and XLS files which require an additional step in processing - the selection of hints. See preview for more info.

Possible values: new, hints, date_formats, processing, error, completed
error
readonly
string

Import error in case status is error

Possible values: unknown, amount, date, hints
preview
read, write
array

Preview includes CSV/XLS file preview of the header and a couple of lines, to show to the user.

name
read, write
string

In case of XLS files, sheet name is returned. Otherwise this parameter is skipped.

hints
readonly
array

Header hints. Tries to guess hint type based on previous selections.

Possible values: date, amount, expense, income, currency, description, payee, account, category, tags, skip
header
readonly
array

Array of file header column names

rows
readonly
array

A few row previews

metadata
read, write
object

Information about the imported file

expenses
readonly
integer

Expense count

incomes
readonly
integer

Income count

from
readonly
string

From timespan date

Format: date
to
readonly
string

To timespan date

Format: date
accounts
readonly
array

An array of accounts used to import transactions.

formats
read, write
object

Date formatting

available
read, write
array

Available date formats to choose from

selected
read, write
string

Selected date format. This will then be used to parse all the dates.

examples
read, write
array

Date examples

filename
read, write
string

Name of the uploaded file

review
readonly
integer

Number of entries to review.

* denotes required field/parameter.