/v1/establishments/{id}/head-officeMakes this branch the Head office and the Head office a branch, both as new versions naming the key or the person, in one step: the company has exactly one Head office before and after. Earlier versions are kept unchanged. Only a branch becomes the Head office. A VAT registration only is not established in its country, and an establishment whose kind is not stated must first be saved as a branch. Asked of the Head office itself, nothing is saved. The answer is the establishments as GET /v1/establishments lists them, the Head office first.
Path parameters
- idstring (uuid)Required
The
establishmentIdof the branch.
Response
A 200 answer carries these fields.
- establishmentsarray of objectRequired
Show 12 child fields
- establishmentIdstring (uuid)Required
The establishment
- versionintegerRequired
- kindstringRequired
head_office: where the company is seated; exactly one per company, and it stays the Head office.branch: a permanent establishment in another place.vat_registration: registered for VAT there, with no establishment. Null: not stated yet; a later version may state it.One ofhead_office,branch,vat_registration,null. - countrystringRequired
The country of the establishment, as an ISO 3166-1 code. It never changes: another country is another establishment.
- namestring or nullRequired
A name the company gives it, such as Berlin HQ.
- vatIdstring or nullRequired
Its VAT ID, starting with the prefix of an EU member state (Greece: EL). Spaces and dots are removed and letters made capitals. A new VAT ID is checked with VIES, the European Commission's VAT number check, and the answer is returned as
vies. - viesobject or nullRequired
VIES's answer about the VAT ID; null when there is no VAT ID.
Show 4 child fields
- statusstringRequired
unavailablemeans VIES could not answer, never that the number is invalid.One ofvalid,invalid,unavailable. - requestDatestring (date-time) or nullRequired
- namestring or nullRequired
- addressstring or nullRequired
- taxNumberstring or nullRequired
Its national tax number, such as a German Steuernummer.
- addressobject or nullRequired
Its postal address, as invoices state the seller's.
Show 4 child fields
- streetstring or null
- postcodestring or null
- citystring or null
- countrystring or null
An ISO 3166-1 country code.
- contactobject or nullRequired
Whom a buyer contacts about an invoice.
Show 3 child fields
- namestring or null
- phonestring or null
- emailstring or null
- electronicAddressobject or nullRequired
Where it receives e-invoices: the scheme and the address, both or neither.
Show 2 child fields
- schemestringRequired
A scheme of the official electronic address scheme list, such as 9930 or 0204.
- valuestringRequired
- factsobjectRequired
Each fact a country's rules ask of an establishment that this one states, named as the rules name it, such as where its supplies are usually made.
GET /v1/jurisdictionslists each fact with whom it is asked of, its type and values. A fact asked of the legal company goes in the company facts, and a buyer's with the buyer. Each value is checked against the rule file that defines it. Left out or empty: none stated.
Status codes
| Status | Meaning |
|---|---|
200 |
The establishments after the move. |
400 |
The establishment is not a branch (invalid_establishment). The message names the kind. Nothing was saved. |
401 |
No usable credential was sent (invalid_credentials). |
404 |
This company has no establishment by that id (not_found). |
409 |
Someone saved the branch or the Head office meanwhile (version_conflict). Nothing was saved. Read them again, then try again. |
501 |
This deployment has no database, so it keeps no establishments (no_database). Sending the same request again will not help. |
/v1/establishments/{id}/head-officecurl -X POST https://api.certinvo.com/v1/establishments/$ESTABLISHMENT_ID/head-office \
-H "Authorization: Bearer $CERTINVO_API_KEY"const establishmentId = '3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a'
const response = await fetch(`https://api.certinvo.com/v1/establishments/${establishmentId}/head-office`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
},
})
console.log(response.status, await response.json())import os
import requests
establishment_id = "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"
response = requests.post(
f"https://api.certinvo.com/v1/establishments/{establishment_id}/head-office",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}"},
)
print(response.status_code, response.text){
"establishments": [
{
"establishmentId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
"version": 0,
"kind": "head_office",
"country": "string",
"name": "string",
"vatId": "string",
"vies": {
"status": "valid",
"requestDate": "2026-09-17T09:30:00Z",
"name": "string",
"address": "string"
},
"taxNumber": "string",
"address": {
"street": "string",
"postcode": "string",
"city": "string",
"country": "string"
},
"contact": {
"name": "string",
"phone": "string",
"email": "string"
},
"electronicAddress": {
"scheme": "string",
"value": "string"
},
"facts": {}
}
]
}