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 — Fixed-width, XML, and JSON
- Import operations — What types of data can be sent
- How data is mapped — From file fields to Amili's data model
- Pre-built templates — Systems with ready-made configurations
Supported File Formats
Amili can process files in three structured formats. The right choice depends on what your source system can export.
| Format | Description | Typical use |
|---|---|---|
| Fixed-width | Plain text file where each field occupies a fixed character position on each line | Accounting and ERP systems that export legacy flat files |
| XML | Structured markup format with nested elements | Healthcare journal systems, invoice exports, Peppol e-invoicing |
| JSON | Structured text format with key-value pairs and arrays | Modern 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.
| Operation | Description |
|---|---|
| Invoice registration | Submit a new invoice for processing. Amili creates an invoice and an associated case in the platform. |
| Case registration | Submit a debt or claim directly as a case, without first creating an invoice. Used when the invoice lifecycle is handled externally. |
| Creditor payment | Notify Amili that a payment has been received directly by the creditor, outside of Amili's payment flow. |
| Creditor cancellation | Cancel a previously registered case or invoice. |
| Creditor crediting | Credit 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:
| Field | Description |
|---|---|
| Name | Full name of the customer |
| Identity number | Swedish personal identity number (personnummer) or organization number |
| Address | Street address, zip code, city, country |
| Mobile number | Customer phone number for communications |
| Customer email address for communications | |
| Customer number | Your 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:
| Field | Description |
|---|---|
| Invoice number | Your invoice reference, used to identify the record |
| Invoice date | Date the invoice was issued |
| Invoice due date | Payment due date |
| Amount | Original invoice amount (capital) |
| Currency | ISO currency code, e.g. SEK |
| Description | Free-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:
| Field | Description |
|---|---|
| Invoice reference | Reference matching the payment to an existing case or invoice |
| Payment date | Date the payment was received |
| Amount | Amount paid |
| Currency | ISO 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
- SFTP File Drop-off & Pickup — How to deliver files to Amili and retrieve report files
- File Integration Process — The end-to-end onboarding process for file integration
