Use case · Accounts payable and ERP
Clean your vendor master data against the official company registers
Export the vendor table, resolve every row against the official company register of its country, write back the registry key, and flag what has been dissolved: in batches of 100, from one REST API and one key.
The problem in an ERP
A vendor master grows one request at a time. The same supplier is entered twice under two spellings, a tax number does not match the name next to it, a supplier that was dissolved two years ago is still on the payment run, and nothing in the table says which legal entity a row stands for. Without a stable key, every later check (duplicates, sanctions, e-invoicing, audits) starts by guessing which company a row means.
This page is about that cleanup job: giving each vendor row the official registry key of its company, then reading what the register says about it. It is a data-quality loop, not a screening file; for sanctions and insolvency screening of a list see batch screening and supplier due diligence, and for the sales-side version of the same lookup see CRM company data enrichment.
The loop, in five steps
- Export. One row per vendor: your own vendor id, the country, and whatever identifier you hold (national company number, SIREN, NIF, a VAT number, or just the name).
- Resolve.
POST /companies/lookuptakes up to 100 rows per call. Each row costs 1 credit; an over-quota batch is refused up front with 429batch_exceeds_quotaandmax_items_now, so nothing is half-run. Each result has astatus(found,not_found,errorortimeout; atimeoutcan be resent) and the company object. - Write back the key. Store
countryandcompany_numbernext to your vendor id. That pair is the stable key; the legal name,legal_formandaddresscome with it. - Read the status and the VAT number.
status,status_groupanddissolution_datesay whether the register still lists the company as trading;vat_numberandvat_number_sourceare explained below. - Keep it clean.
POST /insolvency/checkon the full list, andPOST /monitoron the vendors that matter.
# 1. Resolve a vendor export, up to 100 rows per call (1 credit per row)
curl -X POST "https://api.prometiam.com/functions/v1/risk-api/companies/lookup" \
-H "Authorization: Bearer rk_live_..." \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "country": "ES", "company_number": "A46103834" },
{ "country": "FR", "siren": "552032534" },
{ "country": "ES", "name": "Inditex" }
]
}'
# 2. Confirm an EU VAT number with VIES (1 credit; a number built by rule is not confirmed)
curl "https://api.prometiam.com/functions/v1/risk-api/vat/ESA46103834" \
-H "Authorization: Bearer rk_live_..."
# 3. Corporate insolvency notices for the whole list (2 credits per row, sixteen markets)
curl -X POST "https://api.prometiam.com/functions/v1/risk-api/insolvency/check" \
-H "Authorization: Bearer rk_live_..." \
-H "Content-Type: application/json" \
-d '{ "items": [ { "country": "FR", "company_number": "552032534" } ] }'
# 4. Keep the vendors that matter under watch (company_id comes from step 1)
curl -X POST "https://api.prometiam.com/functions/v1/risk-api/monitor" \
-H "Authorization: Bearer rk_live_..." \
-H "Content-Type: application/json" \
-d '{ "company_id": 812044, "country": "ES", "label": "vendor 40017",
"webhook_url": "https://erp.example.com/hooks/prometiam" }'A worked example: a CSV in, a CSV out
A batch job over a vendor export. It keeps one output row per vendor, so a not-found vendor stays visible instead of dropping out of the file.
import csv, os, requests
API = "https://api.prometiam.com/functions/v1/risk-api"
HEAD = {"Authorization": f"Bearer {os.environ['PROMETIAM_API_KEY']}"}
def batches(rows, size=100):
for i in range(0, len(rows), size):
yield rows[i:i + size]
# vendors.csv: vendor_id, country, tax_id (the vendor's national company number)
rows = list(csv.DictReader(open("vendors.csv", newline="")))
out = []
for batch in batches(rows):
items = [{"country": r["country"], "company_number": r["tax_id"]} for r in batch]
resp = requests.post(f"{API}/companies/lookup", json={"items": items}, headers=HEAD)
if resp.status_code == 429: # batch_exceeds_quota: the body says max_items_now
print(resp.json())
break
for row, res in zip(batch, resp.json()["data"]):
c = res.get("company") or {}
out.append({
"vendor_id": row["vendor_id"],
"lookup": res["status"], # found | not_found | error | timeout
"registry_key": f'{c.get("country")}:{c.get("company_number")}' if c else "",
"legal_name": c.get("company_name", ""),
"status": c.get("status", ""),
"status_group": c.get("status_group", ""),
"dissolution_date": c.get("dissolution_date") or "",
"vat_number": c.get("vat_number") or "",
"vat_number_source": c.get("vat_number_source") or "", # register | rule
})
with open("vendors_clean.csv", "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=list(out[0].keys()))
w.writeheader()
w.writerows(out)A not_found row is not an error: the identifier may be mistyped, the entity may sit in a country outside the live countries, or it may be a private person. Send those rows to a person, not to a retry loop.
Reading vat_number and vat_number_source
Every company object carries vat_number and vat_number_source. The source matters before you write the number into a master record:
register: the register publishes the number or confirms the VAT registration (for instance Estonia, Norway, Finland and Belgium; Latvia, Slovakia and Lithuania from their tax administrations' lists of VAT payers).rule: the number is built from the company's identifier with the national format (Spain, France, Poland, Sweden and others). The format is right; the registration is not confirmed. Confirm an EU number withGET /vat/{vatNumber}(1 credit, EU member states plus Northern Ireland; VIES has no Norway or Switzerland, and Great Britain is out of scope).null: the register says the company is not VAT-registered, or no rule exists for that country.
When VIES is temporarily down the call answers 503 (retryable) instead of saying the number is invalid, so a 503 is a reason to retry later, never a reason to flag a vendor.
Deduplicate on the registry key
Two vendor rows that resolve to the same country and company_number are one legal entity: merge them, or at least link them. Look at match_type before you trust a merge: exact means the identifier or the whole name matched; a name-only row also carries match_score (0 to 100), and anything below an exact match is a candidate for a person to confirm, not a decision.
A company that has been merged into another keeps its own record with a status that says so (status_qualifier dissolved_merger where the register states it); what to do with such a vendor is your decision, the API only shows what the register says.
Keep the list clean
Cleansing once and drifting again is the usual story. Two calls keep it from happening:
POST /insolvency/checkaccepts up to 100 rows per call at 2 credits each and returns up to five notices per row, newest first, plus the latest filing date. It covers corporate insolvency only, in sixteen markets: FR, DE, GB, AT, CH, NO, FI, US, NL, DK, HR, SE, ES, LV, EE and SG. A result ofnonemeans no notice was found in those markets, not that the vendor is solvent.POST /monitorsubscribes a company and pushes a signed webhook on a status change, a dissolution, a sanctions match (beta) and corporate events. Monitored companies are 25 on Starter, 250 on Professional and 2,500 on Scale. It is available in every live country except CL, KR, NC, PE, HN, GT, UY, DO, NZ, BG, GE, TZ, ZM and PY, so choose the vendors that matter and cover the rest with a periodic lookup.
Where a register states no dissolution date (many US registrations, Canada, Israel, Singapore, Taiwan, Romania, Serbia), the dissolution alert fires when the status becomes closed and is dated by the check that first sees it: detail.date_basis is first_seen_closed then, and register when the register's own date is used.
What you do not get
- No bank-account or IBAN verification, and no check that an invoice reference exists.
- No company outside the live countries; see
GET /coveragefor the list and how fresh each country is. Sole proprietorships appear only where a country's register publishes them; a private person is never matched. - Germany is covered for companies that hold a Legal Entity Identifier and for operators in the energy-market register, not for every company in the commercial register, so a German vendor can come back
not_foundalthough it exists. - Insolvency notices: corporate only, the sixteen markets above. Contains CVR data (Erhvervsstyrelsen), CC BY 4.0.
- No credit score and no payment behaviour. Sanctions screening is a separate call (beta, 3 credits a name) and is not part of this loop.
Credits for a vendor list
Resolving 5,000 vendors is 5,000 credits (1 per row): within one month of Professional (EUR 29.99, 10,000 credits), and five months of Starter (EUR 9.99, 1,000 credits a month). A POST /insolvency/check over the same list adds 2 credits a row, and a VAT confirmation adds 1 per number. Errors cost nothing, and every response carries X-Credits-Cost. Start with a sample of a few hundred rows to see how many resolve before you run the whole export.
FAQ
How do I clean vendor master data against official registers?
Export one row per vendor with its country and any identifier, resolve the rows in batches of 100 with POST /companies/lookup, store the returned country and company_number as the vendor’s registry key, then read status, dissolution_date and vat_number on the result. Rows that do not resolve go to a person.
Is a VAT number from the API confirmed?
Only when vat_number_source is register. When it is rule, the number was built from the company’s identifier: the format is right but the registration is not confirmed. Check an EU number with GET /vat/{vatNumber} (1 credit); VIES covers no Norwegian or Swiss numbers.
What does a lookup batch cost, and what if it is over my quota?
Each row is 1 credit. A batch that does not fit the remaining quota is refused up front with 429 batch_exceeds_quota and max_items_now, so nothing is partly processed. Errors are free.
Does it find insolvent or dissolved vendors?
status, status_group and dissolution_date show what the register says, and POST /insolvency/check looks for corporate insolvency notices in sixteen markets (FR, DE, GB, AT, CH, NO, FI, US, NL, DK, HR, SE, ES, LV, EE, SG). No result means no notice found in those markets, not proof of solvency.
Related
- Debt collection: check the debtor company: what the registers show when a company invoice goes unpaid
- Depurar el maestro de proveedores con los registros oficiales (en español)
- Nettoyer le référentiel fournisseurs avec les registres officiels (en français)
- Lieferantenstammdaten mit den amtlichen Firmenregistern bereinigen (auf Deutsch)
- Supplier due diligence: the screening loop for a new or existing supplier base
- CRM company data enrichment: the same lookup for a sales CRM
- Batch screening: sanctions and insolvency checks over a list
- VAT and VIES validation API: confirming an EU VAT number
- Ongoing due diligence: monitoring after the cleanup