Skip to content

File Formats and Data Types

Amili's file import pipeline accepts structured data files delivered over SFTP. Any system that can export structured data can be integrated, but well-known or standardized export format generally means a faster setup with less configuration work on both sides.

This guide explains what file formats Amili supports, what types of data can be imported, and how the data in a file is mapped and imported into the Amili platform.

Table of Contents


Supported File Formats

Amili can process files in three structured formats. The right choice depends on what your source system can export.

FormatDescriptionTypical use
Fixed-widthPlain text file where each field occupies a fixed character position on each lineAccounting and ERP systems that export legacy flat files
XMLStructured markup format with nested elementsHealthcare journal systems, invoice exports, Peppol e-invoicing
JSONStructured text format with key-value pairs and arraysModern systems and APIs with JSON export capabilities

Fixed-width

Fixed-width files (also called flat files or positional files) encode data as lines of text where each field starts and ends at a specific character position. Different line types are identified by a prefix at the start of each line.

A single file typically contains several record types — for example, one line type for the customer and another for each invoice or debt. Amili's import configuration defines the exact positions and data types of each field.

XML

XML files carry data as structured, nested elements. Amili uses XSLT transformations to read the source XML structure and map it to Amili's data model. This makes XML integration flexible — Amili can adapt to a wide range of XML schemas without requiring changes to your export format.

JSON

JSON files carry data as objects and arrays. Amili uses jq transformations to extract and map fields from the JSON structure. JSON is well-suited for systems that already produce machine-readable output, or where the source data is delivered as a structured API export.


Import Operations

Amili supports five types of file-based import operations. A single integration can use one or more of these, depending on what your system exports.

OperationDescription
Invoice registrationSubmit a new invoice for processing. Amili creates an invoice and an associated case in the platform.
Case registrationSubmit a debt or claim directly as a case, without first creating an invoice. Used when the invoice lifecycle is handled externally.
Creditor paymentNotify Amili that a payment has been received directly by the creditor, outside of Amili's payment flow.
Creditor cancellationCancel a previously registered case or invoice.
Creditor creditingCredit a previously registered case, reducing the outstanding amount.

Not all operations need to be set up from the start. A common starting point is invoice registration, with payment, cancellation, and crediting added as needed.


How Data is Mapped

When Amili processes a file, each record is transformed and mapped to the corresponding import in the platform. The transformation logic reads the fields from your file and produces the data structure that Amili's API expects.

The diagram below shows the overall flow:

Customer information

For invoice and case registrations, Amili extracts information about the end customer from the file. The following fields are mapped:

FieldDescription
NameFull name of the customer
Identity numberSwedish personal identity number (personnummer) or organization number
AddressStreet address, zip code, city, country
Mobile numberCustomer phone number for communications
EmailCustomer email address for communications
Customer numberYour internal reference for this customer (optional)

Fields that are optional in the source file will be left blank in Amili if not provided.

Invoice and debt information

For invoice and case registrations, the financial data is mapped as follows:

FieldDescription
Invoice numberYour invoice reference, used to identify the record
Invoice dateDate the invoice was issued
Invoice due datePayment due date
AmountOriginal invoice amount (capital)
CurrencyISO currency code, e.g. SEK
DescriptionFree-text description of the debt or service

For invoice registrations, line items (articles) can also be included — for example individual services or goods with unit prices and VAT rates.

Payment information

For creditor payment files, Amili extracts:

FieldDescription
Invoice referenceReference matching the payment to an existing case or invoice
Payment dateDate the payment was received
AmountAmount paid
CurrencyISO currency code

Pre-built Templates

Amili has ready-made import templates for a number of commonly used systems. If your system is among them, initial setup is typically faster since the field mapping is already defined.

Examples of systems with pre-built templates

The following systems have existing templates and configurations:

  • Visma Business — Case registration and payment files (fixed-width)
  • Visma RoR / RoR v2.1 — Case registration (fixed-width), Peppol invoice (XML)
  • Agresso CU12 — Case registration (fixed-width)
  • Cosmic — Invoice registration and cancellation (XML)
  • SARA — Invoice registration and cancellation (JSON)
  • Webdoc — Invoice registration and crediting (XML)

These are examples of systems with pre-built templates — integrations are not limited to these.

If your system is not listed, Amili can build a custom template — the requirement is that your system can export data in one of the three supported formats (fixed-width, XML, or JSON) containing the fields described above.

What to prepare for a custom integration

If you are integrating a system that does not have a pre-built template, bring the following to the initial setup discussion with Amili:

  • A sample export file from your system, representative of real production data
  • A field description explaining what each field or column in the export contains
  • A clear picture of which operations you want to support (invoice registration, payments, etc.)

Amili will use this input to build a template and validate it against your sample data before going live.


Next Steps