This is a recipe, not a HubSpot app and not a marketplace listing. A custom code action in a HubSpot workflow reads a company's country, register number and VAT number, calls the Prometiam API with a key held as a HubSpot secret, and returns the legal name, status, legal form and VAT result for a later step to write to company properties.
There is no Prometiam app in the HubSpot marketplace and no native HubSpot connector. What works today is HubSpot's own Custom code workflow action, which runs a short Node.js function, and our REST API. The pages under Integrations say which channels are live: the n8n node, Postman, the SDKs and the MCP server. HubSpot is not one of them, so this page is code you paste into your own workflow, nothing you install.
Read from HubSpot's developer page on custom code actions on 26 November 2026 (developers.hubspot.com, "Workflows | Custom Code Actions"; its robots.txt allows reading it). Check the page again before you build, because HubSpot changes it.
exports.main = (event, callback) => { ... }. event.inputFields holds the properties you add under "Properties to include in code" (up to 50). callback({ outputFields: { ... } }) returns the values.process.env.SECRET_NAME. The total length of all secret values must not exceed 1,000 characters.axios ^1.2.0 is on the supported list, so the code below uses it.@hubspot/api-client, HubSpot reattempts for up to three days, starting one minute after the failure.The page's sample event shows a contact ("objectType": "CONTACT"). The code below does not use the object at all, only the input fields, so it does not depend on the object type. Confirm in your portal that the action is offered in a company-based workflow.
Add three properties under "Properties to include in code" and name them exactly: country (two letters, for example ES), register_number and vat_number (with its country prefix). Add the secret PROMETIAM_API_KEY. Declare seven string outputs, named as in the code. The function makes up to two calls of 1 credit each: the company record from GET /companies/by-identifier, then the VAT number from GET /vat/{number}.
const axios = require('axios');
const BASE = 'https://api.prometiam.com/functions/v1/risk-api';
exports.main = async (event, callback) => {
const key = process.env.PROMETIAM_API_KEY; // the HubSpot secret
const http = axios.create({
baseURL: BASE,
headers: { Authorization: `Bearer ${key}` },
timeout: 8000,
// 429 and 5xx throw an axios error, which HubSpot retries; every other status is read below
validateStatus: (status) => status < 429,
});
const country = (event.inputFields['country'] || '').trim().toUpperCase();
const registerNumber = (event.inputFields['register_number'] || '').trim();
const vat = (event.inputFields['vat_number'] || '').replace(/[\s.-]/g, '');
const out = {
legal_name: '', company_status: '', legal_form: '',
vat_check: 'not_checked', vat_vies_name: '', vat_register_match: '', check_note: '',
};
// Call 1 (1 credit): the company record, by register number or, without one, by VAT number.
let params = null;
if (country && registerNumber) params = { type: 'company_number', country, value: registerNumber };
else if (vat) params = { type: 'vat', value: vat };
if (params) {
const r = await http.get('/companies/by-identifier', { params });
if (r.status === 200) {
const c = r.data.data;
out.legal_name = c.company_name || '';
out.company_status = c.status || '';
out.legal_form = c.legal_form || '';
} else if (r.status === 404) {
out.company_status = 'not_found';
} else {
out.check_note = `record call refused: ${r.status} ${r.data?.error?.code || ''}`;
}
}
// Call 2 (1 credit): the VAT number against VIES. EU numbers only (no NO, no CH, no GB).
if (vat) {
const v = await http.get(`/vat/${encodeURIComponent(vat)}`);
if (v.status === 200) {
out.vat_check = v.data.data.is_valid ? 'valid' : 'invalid';
out.vat_vies_name = v.data.data.name || ''; // VIES withholds the name for some member states
out.vat_register_match = v.data.data.registry_match?.company_name || ''; // our register's company under that number, not a VIES answer
} else if (v.status === 400) {
out.vat_check = 'not_an_eu_number';
} else {
out.vat_check = 'error';
}
}
callback({ outputFields: out });
};
The choices in it: with a register number and a country it finds the company by that number, and without one it falls back to the VAT number. vat_check is valid, invalid, not_an_eu_number or error. VIES withholds the registered name for some member states, so vat_vies_name can be empty; vat_register_match is the company our register holds under that number, which is register data and not a VIES answer. A 429 or a 5xx makes axios throw, which is the case HubSpot says it retries.
The function above was run locally with a test event shaped like HubSpot's sample (portal id 1, action id 2, object id 4, and the three input fields) against the live API with the public demo key, the key read from PROMETIAM_API_KEY in the environment. Telefonica's Spanish NIF and VAT number went in. It made two calls, used 2 credits and returned:
{
"outputFields": {
"legal_name": "TELEFONICA SA",
"company_status": "active",
"legal_form": "SA",
"vat_check": "valid",
"vat_vies_name": "",
"vat_register_match": "TELEFONICA SA",
"check_note": ""
}
}
With a simulated 503 from the VAT call the function ends in an axios error (Request failed with status code 503), which is the case HubSpot's page says it retries.
What was not run: the code inside a HubSpot portal. That needs a Data Hub account, so the workflow editor, the secret store, the output types and the retry behaviour are described from HubSpot's page, not observed. Test the action with HubSpot's own "Test action" on a dedicated test record before you turn the workflow on, as its page recommends.
After the custom code action, add an Edit records action and copy each output into a company property you create for it: legal_name to a text property, company_status and legal_form to text or dropdown properties, vat_check to a dropdown with the four values above. A later branch can use vat_check or company_status to route a record to a person. HubSpot's page links its list of compatible source and target property types.
| Output | What it tells you |
|---|---|
legal_name | The name the register holds for the company. Empty when no company was found. |
company_status | The register's status, normalised (active for Telefonica above), or not_found. |
legal_form | The normalised legal form, such as SA. |
vat_check | The VIES result for the VAT number: valid means the number is registered for VAT, nothing more. |
vat_vies_name | The name VIES returned, often empty. |
vat_register_match | The company our register holds under that VAT number. Not confirmation of VAT registration. |
check_note | A short note when a call was refused, for example a 400 for a malformed number. |
GET /vat/{number} covers the 27 EU member states and Northern Ireland (XI). VIES has no Norway or Switzerland, and GB VAT is out of scope after Brexit; those numbers come back as not_an_eu_number.vat_number_source rule): the format is right and the registration is not confirmed. Only the VIES result confirms it.GET /insolvency/search, 2 credits) are corporate only, in sixteen markets, and no notice is not proof of solvency. Sanctions screening is beta.The free trial lasts 14 days and includes 500 credits. A card is required and nothing is charged during the trial; it then continues as Starter (EUR 9.99/month) unless you cancel.