PharmAPI: B2B Counterparty Due Diligence

PharmAPI

PharmAPI is a B2B counterparty due diligence platform: it pulls company data from dozens of sources, computes a reliability rating, and watches for changes around the clock. I was its CTO and lead engineer, responsible for the architecture, the API, and the scoring layer.

The customers are banks, insurers, and corporates with long lists of suppliers and buyers. In other words, everyone who keeps answering the same question: can we safely do business with this company?

The problem: the decision is due today, the data ages fast

A company is about to ship goods on deferred payment, issue a loan, or sign with a new supplier. To understand the exposure, an analyst manually assembles registry extracts, financial statements, court case records, enforcement proceedings, ownership details, and the news background. That takes hours per company and weeks for a portfolio of a hundred counterparties.

The bigger issue is not the effort, though. A manual check goes stale the moment it is finished. A company that looked healthy in March may pick up a major lawsuit by June, lose a licence, or slide toward insolvency. Between two point-in-time checks the business is flying blind, and it usually learns about the counterparty’s trouble last, once the payment fails to arrive.

What the PharmAPI platform does

PharmAPI folds scattered sources into a single dossier and keeps it current without human involvement.

  • A full report in under 4 minutes. Registration data, financials, court cases, debts, owners and affiliated entities, mentions in open sources, all in one document instead of ten browser tabs.
  • A thousand-company portfolio in roughly one working day. A quarterly review of the entire counterparty base stops being a month-long project.
  • 24/7 monitoring instead of one-off checks. A new lawsuit, a change of director, the start of bankruptcy proceedings: the alert arrives when the event happens, not six months later.
  • Scoring on the client’s own model. A bank sets its own weights for capital, debt load, and litigation history, then gets a rating in its own frame of reference rather than an abstract reliability score.

Engineering decisions

API-first, not an interface with an API bolted on. The key architectural call in PharmAPI was made at the start: every function is available programmatically, and the web interface is just another REST API client, exactly like the customer’s own systems. This is what the product is bought for. The check happens the moment a counterparty is entered into a CRM or enters a loan approval pipeline, and the employee never opens a separate service at all.

Microservices for uneven load. Inside PharmAPI, data collection, scoring, report generation, and monitoring live in separate services, for a practical reason: their load does not grow in step. A bulk portfolio review hammers collection and scoring, while overnight monitoring only polls sources. Scaling those parts independently is cheaper than sizing one monolith for the worst case.

NLP where the data is not structured. Registries return tables, but court rulings and news return text. Natural language processing is what tells a plaintiff company from a defendant one and extracts the substance of a dispute. Without it, “party to 40 cases” says nothing about risk.

Industry benchmarks. A debt load that is normal for a construction firm is alarming for a retailer. Assessment is calculated against the benchmarks of the counterparty’s own sector and region, otherwise a universal model just churns out false alarms.

Data isolation as a requirement, not an option. PharmAPI’s clients are financial institutions, so per-user permissions inside the customer organisation, encrypted storage, and HTTPS-only transport were designed in from day one. For banks with strict internal policy there is a deployment option inside their own perimeter.

Stack

  • Backend: Java/Kotlin with Spring Boot for services, Python for data processing and analysis
  • Storage: PostgreSQL for structured registry and reporting data, NoSQL for text corpora
  • Analytics: ML credit scoring models, NLP for parsing court documents and news
  • Infrastructure: containerisation and orchestration, horizontal scaling, redundancy for critical components
  • Integration: RESTful API with access keys and encryption

My role in the project

  • CTO and lead developer. Architectural decisions, the core backend, taking PharmAPI from concept to production, and leading the engineering team.
  • API design. The contracts, versioning, and access model that integrations with banking systems and customer CRMs were built on.
  • Data pipelines and scoring. The source aggregation layer, normalisation of heterogeneous data, and integration of ML models into the rating calculation.

The underlying task is the same one as in Monolith Plus: turning scattered and not always clean data into a basis for a decision you can actually trust. On how that fits into the management loop, I wrote separately about integrated risk management.

Frequently Asked Questions

What is PharmAPI? A B2B counterparty due diligence platform: registry, court and financial data, a reliability rating, affiliated entity detection, and round-the-clock monitoring of changes.

How fast is a report produced? Under 4 minutes for a single company. A portfolio of a thousand counterparties is processed in roughly one working day.

Can the checks be embedded into our own systems? Yes, the platform is API-first: every function is available through a RESTful API, and checks embed into banking systems, CRM and ERP.

How is this different from a one-off check? A one-off check is stale immediately. Monitoring sends an alert at the moment of the event: a lawsuit, a change of management, signs of insolvency.


Need a Consultation?

If you are building a data platform or want counterparty checks embedded into processes you already run, book a free 15-minute call. We will go through your case and where automation should stop.