CVR number vs. P-number
| CVR number | P-number | |
|---|---|---|
| Identifies | The legal entity | A physical location (production unit) |
| Length | 8 digits | 10 digits |
| Per company | One | One per address the company operates from |
| When relocating | Kept | Typically the unit closes and a new one is created at the new address |
| In CVR-API | vat | p_units[].p_number |
What are P-numbers used for?
- Statistics and registering employees at the right workplace.
- Authorities supervising specific locations, such as food inspections.
- Finding every store, branch or warehouse of a chain.
- Delivery addresses and branches in CRM and ERP systems.
Production units in CVR-API
A lookup on /api/v1/{cvr} returns the company's production units in the p_units list. Each unit has its own name, address, industry, headcount, contact details and its own protected flag for marketing protection.
{
"vat": 10403782,
"name": "VESTAS WIND SYSTEMS A/S",
"p_units": [
{
"p_number": 1017864846,
"name": "Vestas Wind Systems A/S",
"address": "Sahara 7",
"zipcode": 6700,
"city": "Esbjerg",
"startdate": "2012-08-17",
"enddate": "2013-02-13",
"industrycode": 721900,
"protected": false
},
...
]
}The list also includes closed units. enddate is set for units that have closed and null for active ones. To keep only the active units:
import requests
company = requests.get("https://apicvr.dk/api/v1/10403782").json()
active = [p for p in company["p_units"] if not p["enddate"]]
for unit in active:
print(unit["p_number"], unit["address"], unit["zipcode"], unit["city"])Frequently asked questions
How many digits does a P-number have?
A P-number has 10 digits; a CVR number has 8.
Can a company have several P-numbers?
Yes. A production unit is created for each address the company operates from. Large chains can have hundreds.
Does marketing protection apply to P-units?
Yes. Each P-unit has its own protected field in the API, which you must respect when marketing to that location.