Search by

mago-assistant / magento2-creditsafe

michielgerritsen

Mago Assistant add-on: look up a company's creditworthiness through the Creditsafe Connect API

Package info

github.com/mago-assistant/magento2-creditsafe

Type:magento2-module

pkg:composer/mago-assistant/magento2-creditsafe

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-12-02 15:39 UTC

This package is auto-updated.

Last update: 2026-12-03 07:58:07 UTC


README

Look up the creditworthiness of a B2B customer or prospect in the admin chat panel, without opening the Creditsafe portal. The add-on talks to the Creditsafe Connect API with your own Creditsafe account.

What it does

Ask the assistant, in the admin chat panel:

  • Look up Creditsafe information for KvK 12345678.
  • What is the credit score of the company behind the latest B2B account request?
  • Which credit limit does Creditsafe recommend for customer X, and how does that compare to their average order value?
  • Is this company still active, or has it been declared bankrupt?
  • Show the latest financials and payment behaviour of company Y.

The assistant first searches Creditsafe and asks you to confirm the right company (name, registration number and address). Only then does it order the credit report, and it shows:

  • the risk as 🟢 low, 🟠 medium or 🔴 high, with Creditsafe's rating and score;
  • the recommended credit limit and its currency;
  • a clear warning when the company is not active (bankrupt, dissolved, in liquidation);
  • the payment behaviour (days beyond terms) and the latest key figures, when Creditsafe has them;
  • the report date.

A credit advice is always presented as Creditsafe's recommendation, not as a decision by the assistant.

For a question about an existing customer, the assistant reads the company name, VAT number and order history with Mago's own customer and order tools, which carry their own Magento permissions. This add-on never reads customers or orders itself.

Credits

Searching is free, a credit report can use up credits of your Creditsafe account. That is why the assistant always searches first and asks you to confirm the company, and why ordering a report has its own permission (see below). Which reports cost credits depends on your Creditsafe contract.

Install

composer require mago-assistant/magento2-creditsafe
bin/magento module:enable MagoAssistant_Creditsafe
bin/magento setup:upgrade
bin/magento cache:flush

Mago core needs no change. Disable or remove the module and the Creditsafe tools disappear from the assistant.

Configure

Stores › Configuration › Admin Assistant › Creditsafe:

Field
Environment Sandbox or Live. New Creditsafe accounts start on the sandbox.
Username The username of your Creditsafe Connect API account.
Password Stored encrypted.

The settings apply to the whole installation: the assistant runs in the admin, where no website decides which account to use.

The add-on logs in once and reuses the login token (cached encrypted) until shortly before it expires an hour later. A rejected username or password is remembered for two minutes, because Creditsafe locks the account out after five invalid attempts within two minutes.

Permissions

Each tool has its own ACL resource, under System › Permissions › User Roles › Role Resources › Admin Assistant › Creditsafe:

Resource Allows
MagoAssistant_Creditsafe::search Searching companies, and looking up which search fields a country allows
MagoAssistant_Creditsafe::report Ordering credit reports, which can use up credits

So a role can search companies without being able to spend credits.

Tools

All tools only read: nothing is ever changed in Creditsafe, and no confirmation is asked.

Tool What it does
creditsafe_search_company Finds companies in one country by registration number (e.g. KvK), VAT number, or name with an optional postcode. Returns the connect_id, name, address, registration number and status of each match.
creditsafe_get_credit_report Orders the credit report for a connect_id: rating, risk, recommended credit limit, status, payment behaviour and the latest two years of key figures.
creditsafe_search_criteria Lists which search fields Creditsafe accepts together for a country, for when a search was refused.

The full report holds hundreds of fields. Only the parts above reach the model. Directors and shareholders are left out completely.

Privacy

A company name, address and VAT number are public record for a limited company, but for a sole trader they are a person's name, home address and personal tax number. They are therefore masked: the model receives mago://name_1, and the panel shows you the real value. Registration numbers, ratings and financial figures are sent as they are.

Errors

A missing configuration, a rejected login, an unreachable API, no match, no access or credits for a country or report, and a rate limit each reach the chat as a clear error instead of an exception. Creditsafe's own error text never reaches the model, only its error code (for example ReportUnavailableOnline), because that text can repeat the search terms.

Not included (yet)

  • Monitoring of score or status changes
  • KYC / compliance screening and Bank Match
  • Checking new B2B account requests automatically, or setting credit limits in Magento
  • PDF reports