Skip to content

Technical

Components

  • Custom endpoints.
  • Web component(s): Reads the data from the current state ("card") and sends requests to the endpoint.
  • LIP package for creating the fields.

When clicking the refresh button a request is sent to the Lime server that contacts the provider's service. A result is returned from the service to the Lime server and stored in the Lime database together with a timestamp. The web component is refreshed to show the new rating.

Python Library

To use this package as a library, import the get_rating function from the provider of your choice in limepkg_credit_info.providers.

Providers

Each provider has its own Python package in the limepkg-credit-info/providers folder. Each provider has its own Web component in the frontend/src folder.

Credit Template by Creditsafe

Credit Template is a service provided by Creditsafe.

Custom Endpoint

[POST] /limepkg-credit-info/credit-template/<instance_id>/<limeobject_id>/

Gets a rating from Credit Template and saves it in Lime CRM on success.

Table and Field Definitions Lime CRM

Table names and fields are fully configurable. However, the option field for the rating expects the following keys to exist:

  • empty
  • approved
  • not_approved
  • grace

Note that the option texts for all other languages than Swedish are set to English. This is because the options reflects the official rating text from Credit Template, and Swedish and English are the only languages supported there.

Validation

All validation of registration numbers are done by the Credit Template service, the add-on is not pre-validating before the request is sent. This is by design so that the add-on does not assume things.

However, the config setting onlyAllowPublicCompanies, which is more of a rule, will of course be applied before contacting the Credit Template Service. This means that if the setting is set to true and the registration number is not for a Swedish public company, then there will be no request to Credit Template.

Language/Translations

The Credit Template service supports two languages, Swedish and English. Credit Template only uses the language parameter for localizing error messages. The rating is self is always returned as numbers. If the current user's language is Swedish, Swedish will be requested from Credit Template, all other languages requests English.

Errors

Errors regarding missing configuration, group access etc is handled by the add-on. Errors coming from the Credit Template service are relayed. Read more in the troubleshooting section.

Desktop Client

The Lime CRM Desktop Client is not yet using the same backend as the Web Client version. See documentation for the Desktop Client version instead here.