A software platform that offers Certinvo to its own customers needs one key, not one per customer. An workspace key reaches every company of the platform’s workspace in one environment. This guide shows you how to get one, create a company for each end customer, and name that company on every call.
Step 1: get a workspace key
Certinvo staff make workspace keys. Ask Certinvo for one, and say whether it should reach the live companies or the sandbox companies. One key reaches one environment. A workspace key looks like any other key.
Step 2: create a company per end customer
The platform creates companies itself, with the workspace key:
curl -s -X POST "https://<api-host>/v1/companies" \
-H "Authorization: Bearer cvo_live_sk_..." \
-H "Content-Type: application/json" \
-d '{"name": "Bäckerei Huber", "reference": "cust-4711", "country": "DE"}'referenceis the platform’s own id for its customer. The same request sent again returns the same company with 200 instead of 201, so a retry never creates a duplicate.- The same
referencewith a different name is refused with 409company_reference_conflict. - The company is created in the key’s environment.
- The company uses the workspace’s processing plan. You assign nothing per company. When the plan has a document allowance, every company draws on the same one.
GET /v1/companies lists the workspace’s companies.
Your staff do not need a key to look at a customer. When they sign in to the console, the side menu lists the
companies they reach, and they can switch between them without signing in again. A company your server made with
POST /v1/companies opens straight away, without the setup questions.
Step 3: name the company on every call
Every other route needs a company. With a workspace key, the platform names it in the Certinvo-Company header:
curl -s -X POST "https://<api-host>/v1/validations" \
-H "Authorization: Bearer cvo_live_sk_..." \
-H "Certinvo-Company: <company uuid>" \
-H "Content-Type: application/json" \
--data-binary @validation.jsonvalidation.json is an ordinary validation envelope, {"context": "received", "documents": [{"data": "<base64>"}]},
as in the Quickstart. The operation it starts belongs to the named company. Every later read
of it does too, so poll it with the same Certinvo-Company header.
| Situation | Answer |
|---|---|
No Certinvo-Company header |
400 company_required |
| A company outside the key’s workspace or environment | 404 unknown_company |
A company key used on /v1/companies |
401 workspace_key_required |
A Certinvo-Company header on /v1/companies |
400 company_not_expected |
The header only chooses among companies the key already reaches. For a company that is not the caller’s, the API answers 404, never 403, so it never confirms that the company exists.
Step 4: set each company up once
Right after POST /v1/companies, the same workspace key sets the company up, each call with its Certinvo-Company
header:
| What | Call |
|---|---|
| Hear every step of its invoices | POST /v1/webhooks with your URL. See Hear every step by webhook. |
| Its customers, their files and delivery | PUT /v1/customers. See Give a customer its files and delivery. |
| Send invoices by themselves | PUT /v1/sending. See Send an invoice by email. |
There is no webhook for the whole platform. One POST /v1/webhooks per company, made when you create it, gives you
the same.
Step 5: run without the console
Daily work needs no person in the console:
- A likely duplicate: keep or dismiss it with
POST /v1/invoices/{id}/duplicate. See Decide on a likely duplicate. - A held mail from an unknown sender: list them with
GET /v1/arrivals/not-accepted, and dismiss one withPOST /v1/arrivals/not-accepted/{id}/dismiss. Letting a new sender in changes who may send invoices to the company, so only a signed-in person does that, in the console. A key gets 401session_required. - A file that could not be read: it is listed by the same
GET /v1/arrivals/not-accepted. Download it withGET /v1/arrivals/not-accepted/{id}/filefor 30 days, or delete it withPOST /v1/arrivals/not-accepted/{id}/dismiss. - A file with a virus: it is listed by the same route, with the reason
virus-foundand the virus’s name invirus. It was never kept, so it has no download. Delete it withPOST /v1/arrivals/not-accepted/{id}/dismiss. - Keys: the workspace key is all you need. No key can make another key. A person makes company keys in the console, when a company wants its own.
The request limit
Each key may make 600 requests a minute. Past that, every route answers 429 rate_limited with a Retry-After
header in seconds; wait that long and send the request again. A person signed in to the console is not counted.
Revoke a workspace key
Workspace keys do not appear on the console’s keys screen. To revoke one, ask Certinvo, and give the first 12 characters after its prefix.