/v1/company/factsSaves the company’s company facts as a new version that names the key or the person who saved them. An empty or null field is no value; nothing is filled in. establishedCountry null means the country of the company’s address on each invoice stands for it. facts holds a country’s facts, named as its rules name them: GET /v1/jurisdictions lists each with its type and values. Each value is checked against the rule file that defines it. A fact asked of a buyer is refused here, and so is one asked of an establishment: it is saved on the establishment (PUT /v1/establishments/{id}). A field this request does not have is refused, and the message says a country’s facts go in facts. A partner’s software can save them for each client company: with that company’s key, or with the workspace key and Certinvo-Company: <company id>. A conversion or a validation can also send them with its invoices, as companyFacts.
Request body
application/json, required
- organisationTypestring
What the company is:
business, a business buying for its business, orpublic, a public authority. On a received invoice the company is the buyer, so this is the buyer's type.One ofbusiness,public,null. - establishedCountrystring or null
Where the company is established: its seat, its place of management or a fixed establishment involved in the supply, as an ISO 3166-1 country code. Null: the country of the company's address on each invoice stands for it.
- useAddressAsEstablishmentboolean
Use the address on the invoice as where a party is established. True: the country of the seller's or the buyer's address on the invoice is taken as stated, wherever nothing else states it. False, the default: the check assumes it from the address and says so.
- factsobject
Each fact a country's rules define that the company states, named as the rules name it, such as why its supplies marked exempt from VAT are exempt, or whether it is a micro or small or medium-sized enterprise (true or false).
GET /v1/jurisdictionslists each country's facts with their type and values, and whom each is asked of. Each value is checked against the rule file that defines it. A fact asked of a buyer is refused here: it is saved with the customer. A fact asked of an establishment is refused here too: it is saved on the establishment. An operation'scompanyFactsmay still give either for its own invoices. An empty value is no value.
Response
A 200 answer carries these fields.
- versionintegerRequired
0 when nothing was saved yet.
- organisationTypestringRequired
What the company is:
business, a business buying for its business, orpublic, a public authority. On a received invoice the company is the buyer, so this is the buyer's type.One ofbusiness,public,null. - establishedCountrystring or nullRequired
Where the company is established: its seat, its place of management or a fixed establishment involved in the supply, as an ISO 3166-1 country code. Null: the country of the company's address on each invoice stands for it.
- factsobjectRequired
Each fact a country's rules define that the company states, named as the rules name it, such as why its supplies marked exempt from VAT are exempt, or whether it is a micro or small or medium-sized enterprise (true or false).
GET /v1/jurisdictionslists each country's facts with their type and values, and whom each is asked of. Each value is checked against the rule file that defines it. A fact asked of a buyer is refused here: it is saved with the customer. A fact asked of an establishment is refused here too: it is saved on the establishment. An operation'scompanyFactsmay still give either for its own invoices. An empty value is no value. - useAddressAsEstablishmentboolean
Use the address on the invoice as where a party is established. True: the country of the seller's or the buyer's address on the invoice is taken as stated, wherever nothing else states it. False, the default: the check assumes it from the address and says so.
Status codes
| Status | Meaning |
|---|---|
200 |
The saved version. |
400 |
The facts were refused (invalid_company_facts). The message names the field. Nothing was saved. |
401 |
No usable credential was sent (invalid_credentials). |
501 |
This deployment has no database, so it keeps no company facts (no_database). Sending the same request again will not help. |
/v1/company/factscurl -X PUT https://api.certinvo.com/v1/company/facts \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @body.jsonimport { readFile } from 'node:fs/promises'
const response = await fetch(`https://api.certinvo.com/v1/company/facts`, {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
'Content-Type': 'application/json',
},
body: await readFile('body.json'),
})
console.log(response.status, await response.json())import os
import requests
response = requests.put(
"https://api.certinvo.com/v1/company/facts",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
data=open("body.json", "rb"),
)
print(response.status_code, response.text){
"version": 0,
"organisationType": "business",
"establishedCountry": "string",
"facts": {},
"useAddressAsEstablishment": true
}