Skip to content

Configuration

This section covers all configuration required to set up the Billecta Integration in Lime CRM, including field mappings, commands, reports, and optional features.

Table of Contents:


Billecta Configuration

Some configurations are needed to be done in Billecta in order for their webhook events to be sent to Lime. Read more about how to configure webhook events here


Field Mapping

This package supports configured field mappings as long as the solution follows a similar relational database model as the default field mappings.

Edit this mapping in Lime Admin under the Billecta Integration configuration section.

Debtor Field Configuration

Default debtor field mapping:

[
    { "billecta_field": "OrgNo", "lime_field": "ssnregno" },
    { "billecta_field": "Name", "lime_field": "name" },
    { "billecta_field": "ContactName", "lime_field": "contactname" },
    { "billecta_field": "ContactEmail", "lime_field": "email" },
    { "billecta_field": "Email", "lime_field": "email" },
    { "billecta_field": "Phone", "lime_field": "maincontactphone" },
    { "billecta_field": "Address", "lime_field": "address" },
    { "billecta_field": "ZipCode", "lime_field": "zipcode" },
    { "billecta_field": "City", "lime_field": "city" }
]

Creditor Field Configuration

Default creditor field mapping:

[
    { "billecta_field": "OrgNo", "lime_field": "ssnregno" },
    { "billecta_field": "Name", "lime_field": "name" },
    { "billecta_field": "ContactName", "lime_field": "contactname" },
    { "billecta_field": "ContactEmail", "lime_field": "email" },
    { "billecta_field": "Phone", "lime_field": "maincontactphone" },
    { "billecta_field": "Address", "lime_field": "address" },
    { "billecta_field": "ZipCode", "lime_field": "zipcode" },
    { "billecta_field": "City", "lime_field": "city" }
]

Article Field Configuration

Default article field mapping:

[
    { "billecta_field": "ArticleNumber", "lime_field": "articlenumber" },
    { "billecta_field": "Name", "lime_field": "name" },
    { "billecta_field": "Description", "lime_field": "description" },
    { "billecta_field": "UnitPrice", "lime_field": "unitprice" },
    { "billecta_field": "Unit", "lime_field": "unit" },
    { "billecta_field": "VatRate", "lime_field": "vatrate" },
    { "billecta_field": "IsActive", "lime_field": "active" }
]

Order Field Configuration

Default order field mapping:

[
    { "billecta_field": "OrderNumber", "lime_field": "ordernumber" },
    { "billecta_field": "DebtorOrgNo", "lime_field": "debtor.ssnregno" },
    { "billecta_field": "DebtorName", "lime_field": "debtor.name" },
    { "billecta_field": "OrderDate", "lime_field": "orderdate" },
    { "billecta_field": "DeliveryDate", "lime_field": "deliverydate" },
    { "billecta_field": "Description", "lime_field": "description" },
    { "billecta_field": "Status", "lime_field": "status" }
]

Person Field Configuration

Default person field mapping:

[
    { "billecta_field": "PersonNumber", "lime_field": "personnumber" },
    { "billecta_field": "Name", "lime_field": "name" },
    { "billecta_field": "Email", "lime_field": "email" },
    { "billecta_field": "Phone", "lime_field": "phone" },
    { "billecta_field": "Address", "lime_field": "address" },
    { "billecta_field": "ZipCode", "lime_field": "zipcode" },
    { "billecta_field": "City", "lime_field": "city" }
]

Commands & Components

Commands enable users to perform Billecta-related actions directly from Lime CRM views. Several commands are included with the integration and can be added as promoted/unpromoted actions on relevant limetypes.

See the Frontend Commands Documentation for details on each available command.

Swish Request (Optional)

Enable users to send Swish payment requests directly from invoices:

  1. Add "Billecta: Swish Request" as a promoted action on the invoice limetype
  2. Configure the field that contains the payer's mobile phone number (supports dot notation, e.g., contact.phonenumber)
  3. Optionally customize the default message text

Decorators

Decorators automatically synchronize data between Lime CRM and Billecta. When enabled, they intercept object changes and trigger updates via the Billecta API.

⚠️ Important: If using both decorators (for Lime→Billecta updates) AND webhooks (for Billecta→Lime updates), configure the Billecta API user to prevent infinite loops:

  • In Lime Admin, set "Billecta API User" at the top of the Billecta Integration configuration page
  • This prevents the integration from reacting to changes made by its own API calls

See Decorator Documentation for detailed configuration guides for each decorator type.


Reports

Reports sync data from Billecta with Lime CRM objects and provide accounting views. Two report systems are available:

Account Reconciliation Report

A specialized report for reconciling invoices and transactions between Lime and Billecta. Add "Account Reconciliation Report" as an action on creditor objects.

Action ID: limepkg_billecta_integration.account-reconciliation-report

Example configuration:

{
    "fields": [
        {
            "name": "Fakturanummer",
            "sum_column": false,
            "source": "Billecta",
            "field": "InvoiceNumber"
        },
        {
            "name": "ActionPublicID",
            "sum_column": false,
            "source": "Billecta",
            "field": "ActionPublicId"
        },
        {
            "name": "Beskrivning",
            "sum_column": false,
            "source": "Billecta",
            "field": "Description"
        },
        {
            "name": "Transaktionsdatum",
            "sum_column": false,
            "source": "Billecta",
            "field": "TransactionDate"
        },
        {
            "name": "Typ av faktura",
            "sum_column": false,
            "source": "Lime",
            "field": "invoicetype"
        },
        {
            "name": "Fakturamottagare",
            "sum_column": false,
            "source": "Lime",
            "field": "contact.name"
        },
        {
            "name": "Valuta",
            "sum_column": false,
            "source": "Billecta",
            "field": "Amount.CurrencyCode"
        },
        {
            "name": "Summa",
            "sum_column": true,
            "source": "Billecta",
            "field": "Amount.ValueForView",
            "number_format": "# ##0,00;[Red]-# ##0,00"
        },
        {
            "name": "Typ av summa",
            "sum_column": false,
            "source": "Billecta",
            "field": "AmountType"
        },
        {
            "name": "Konto",
            "sum_column": false,
            "source": "Billecta",
            "field": "Account"
        }
    ],
    "opening_balance": {
        "name_column": "Summa",
        "date_column": "Transaktionsdatum",
        "description_column": "Beskrivning"
    }
}

Report Creator

A flexible reporting tool for creating custom synchronization reports. Use this to create reports that combine data from both systems, filter by custom conditions, and display calculated fields.

Action ID: limepkg_billecta_integration.report-creator

Features:

  • Configure custom Billecta API endpoints to fetch data
  • Define user-facing settings fields (date pickers, checkboxes, etc.)
  • Filter rows using conditions (e.g., exclude verification invoices)
  • Display fields from either Billecta or Lime, matched via ActionPublicId

How to use:

  1. Add "Report Creator" as an action on creditor or promoted views
  2. Create new configurations in Lime Admin under Billecta Integration → Reports
  3. Select the saved configuration when running the action

Pre-configured Report Examples

The following default reports are automatically available. If missing from your configuration, manually create them using these configurations:

Kundreskontra (Accounts Receivable)

Displays invoices and outstanding amounts for customers.

The accountreceivables setting can be used to set date intervals for amounts in three separate columns (time periods)

{
    "name": "Åldersfördelad kundreskontra",
    "config_key": "accountsreceivable",
    "endpoint": "/accounting/accountsreceivable",
    "data_path": "InvoiceAccountsReceivable",
    "billecta_idproperty": "CreditorPublicId",
    "lime_idproperty": "creditorpublicid",
    "settings_fields": [
        {
            "name": "Date",
            "display_name": "Datum",
            "type": "date",
            "required": true,
            "default_today": true
        },
        {
            "name": "ExcludeInvoicesWithPeriodOutsideDate",
            "display_name": "Exkludera fakturor med period utanför datum",
            "type": "boolean",
            "required": false
        },
        {
            "name": "IsPeriodSpecific",
            "display_name": "Inkluderar skapade, öppna fakturor/avier t.o.m. valt datum med period t.o.m. valt datum",
            "type": "boolean",
            "required": false
        },
        {
            "required": false,
            "display_name": "Åldersfördelad kundreskontra",
            "type": "accountreceivables",
            "ar_datefield": "Fakturadatum",
            "ar_valuefield": "Belopp inkl. moms"
        }
    ],
    "conditions": [
        {
            "field": "Typ av faktura",
            "op": "not_equals",
            "value": "Verifikationsfaktura"
        }
    ],
    "fields": [
        {
            "name": "Fakturanummer",
            "source": "Lime",
            "field": "invoice_number",
            "sum_column": false
        },
        {
            "name": "Typ av faktura",
            "source": "Lime",
            "field": "invoicetype",
            "sum_column": false
        },
        {
            "name": "FakturaID (Billecta)",
            "source": "Billecta",
            "field": "ActionPublicId",
            "sum_column": false
        },
        {
            "name": "Fakturamottagare",
            "source": "Lime",
            "field": "person.name",
            "sum_column": false
        },
        {
            "name": "Fakturadatum",
            "source": "Billecta",
            "field": "InvoiceDate",
            "sum_column": false
        },
        {
            "name": "Förfallodatum",
            "source": "Billecta",
            "field": "DueDate",
            "sum_column": false
        },
        {
            "name": "Belopp inkl. moms",
            "source": "Billecta",
            "field": "InvoicedAmountIncludingTax.ValueForView",
            "number_format": "#,##0.00 \"SEK\";[Red]-#,##0.00 \"SEK\"",
            "sum_column": true
        },
        {
            "name": "Återstående belopp",
            "source": "Billecta",
            "field": "RemainingAmountIncludingTax.ValueForView",
            "number_format": "#,##0.00 \"SEK\";[Red]-#,##0.00 \"SEK\"",
            "sum_column": true
        },
        {
            "name": "Valuta",
            "source": "Billecta",
            "field": "InvoicedAmountIncludingTax.CurrencyCode",
            "sum_column": false
        },
        {
            "name": "Fordringskonto",
            "source": "Lime",
            "field": "debitaccountoverride",
            "sum_column": false
        },
        {
            "name": "Periodstart",
            "source": "Billecta",
            "field": "PeriodStart",
            "sum_column": false
        },
        {
            "name": "Periodslut",
            "source": "Billecta",
            "field": "PeriodEnd",
            "sum_column": false
        },
        {
            "name": "Referens",
            "source": "Billecta",
            "field": "YourReference",
            "sum_column": false
        }
    ]
}

Förutbetalda Avier (Prepaid Payments)

Displays prepaid and advance payment records received from customers.

{
    "name": "Förutbetalda avier",
    "config_key": "accountsreceivablepayments",
    "endpoint": "/accounting/accountsreceivablepayments",
    "data_path": "AccountsReceivablePayments",
    "billecta_idproperty": "CreditorPublicId",
    "lime_idproperty": "creditorpublicid",
    "settings_fields": [
        {
            "name": "Date",
            "display_name": "Datum",
            "type": "date",
            "required": true,
            "default_today": true
        }
    ],
    "conditions": [],
    "fields": [
        {
            "name": "Kundnamn",
            "source": "Billecta",
            "field": "DebtorName",
            "sum_column": false
        },
        {
            "name": "Personnummer",
            "source": "Billecta",
            "field": "DebtorOrgNo",
            "sum_column": false
        },
        {
            "name": "Kundens referens",
            "source": "Billecta",
            "field": "YourReference",
            "sum_column": false
        },
        {
            "name": "Inbetalt belopp",
            "source": "Billecta",
            "field": "PaidAmount.Value",
            "sum_column": false
        },
        {
            "name": "Fakturanummer",
            "source": "Billecta",
            "field": "InvoiceNumber",
            "sum_column": false
        },
        {
            "name": "Betaldatum (senaste betalning)",
            "source": "Billecta",
            "field": "LastPaymentDate",
            "sum_column": false
        },
        {
            "name": "Förfallodatum",
            "source": "Billecta",
            "field": "DueDate",
            "sum_column": false
        },
        {
            "name": "Periodstart",
            "source": "Billecta",
            "field": "PeriodStart",
            "sum_column": false
        },
        {
            "name": "Periodslut",
            "source": "Billecta",
            "field": "PeriodEnd",
            "sum_column": false
        }
    ]
}

Remove Successful Logs

Configuration to delete OK (successful) logs older than 90 days:

{
    "inactive": false,
    "cleanup_behaviour": "Delete",
    "related_behaviour": "Choose related objects to delete",
    "name": "Remove Billecta OK logs",
    "limetype": "integration_monitor_log",
    "schedule_name": "",
    "query_filter": {
        "op": "AND",
        "exp": [
            {
                "key": "integration_monitor_batch.integration_monitor.integration_key",
                "op": "IN",
                "exp": [
                    "delete_articles_in_billecta",
                    "upsert_articles_in_billecta",
                    "anonymize_debtors_in_billecta",
                    "upsert_debtors_in_billecta",
                    "credit_invoices_in_billecta",
                    "attest_orders_in_billecta",
                    "upsert_attest_orders_in_billecta",
                    "verification_in_billecta"
                ]
            },
            {
                "key": "_createdtime",
                "op": "<",
                "exp": "$previous_day(90)"
            },
            {
                "key": "logstatus",
                "op": "IN",
                "exp": ["ok"]
            }
        ]
    },
    "additional_responseformat": {}
}

Remove Failed Logs

Configuration to delete failed or stalled logs older than 1 year:

{
    "inactive": false,
    "cleanup_behaviour": "Delete",
    "related_behaviour": "Choose related objects to delete",
    "name": "Remove Billecta FAILED logs",
    "limetype": "integration_monitor_log",
    "query_filter": {
        "op": "AND",
        "exp": [
            {
                "key": "integration_monitor_batch.integration_monitor.integration_key",
                "op": "IN",
                "exp": [
                    "delete_articles_in_billecta",
                    "upsert_articles_in_billecta",
                    "anonymize_debtors_in_billecta",
                    "upsert_debtors_in_billecta",
                    "credit_invoices_in_billecta",
                    "attest_orders_in_billecta",
                    "upsert_attest_orders_in_billecta",
                    "verification_in_billecta"
                ]
            },
            {
                "key": "_createdtime",
                "op": "<",
                "exp": "$previous_year(1)"
            },
            {
                "key": "logstatus",
                "op": "IN",
                "exp": ["donewitherror", "error", "running"]
            }
        ]
    },
    "additional_responseformat": {}
}

To apply:

  1. Open Lime Admin → limepkg-cleanup configuration
  2. Create two new cleanup tasks using the above configurations
  3. Customize the time thresholds ($previous_day(90), $previous_year(1)) as needed