v1, April 2026
Diese Seite ist derzeit nur auf Englisch verfügbar.
API keys are generated in Settings → Workspace → API Key. Pass the key as a Bearer token in the Authorization header:
Authorization: Bearer sk_cobank_a1b2c3d4e5f6...
Send requests to www.cobank.ai — the apex cobank.ai redirects there, and HTTP clients drop the Authorization header across a host change, so a request sent to the apex arrives without your key.
Keys are hashed server-side with SHA-256. cobank never stores the raw key. If you lose the key, revoke it in Settings and generate a new one.
Push structured invoice data from ERPs, accounting software, or custom integrations. Each request can contain up to 100 invoices.
POST https://www.cobank.ai/api/ingest
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"invoices": [
{
"vendor_name": "Kuehne + Nagel AG",
"invoice_date": "2026-03-10",
"total_amount": 29835.60,
"currency": "CHF",
"region": "CH",
"line_items": [
{
"description": "FCL Container Rotterdam-Shanghai",
"spend_amount": 9200,
"quantity": 1,
"unit_of_measure": "TEU"
},
{
"description": "Inland transport Zurich-Rotterdam",
"spend_amount": 3400,
"quantity": 28,
"unit_of_measure": "t",
"distance_km": 820
}
]
}
]
}
| Field | Type | Description | |
|---|---|---|---|
| vendor_name | string | required | Supplier / vendor name |
| invoice_date | string | required | ISO date (YYYY-MM-DD) |
| total_amount | number | optional | Invoice total. If omitted, computed from line items. |
| vat_rate | number | optional | Der auf dem Beleg ausgewiesene Mehrwertsteuersatz, angegeben als Prozentwert – also 19 für 19 %, nicht 0,19. Damit wird der Rechnungsbetrag netto gestellt, bevor er mit Ihren Positionen abgeglichen wird. |
| net_amount | number | optional | Der Rechnungsbetrag ohne Steuer, in derselben Währung wie total_amount. Wenn Ihr System diesen Wert kennt, hat er Vorrang vor vat_rate, denn dann wird nichts aus einem Satz abgeleitet. |
| currency | string | optional | ISO 4217 code. Default: CHF |
| region | string | optional | ISO country code. Default: CH |
| entity_id | string (uuid) | optional | The legal entity this invoice belongs to, as your system of record states it. It is used as sent: if the buyer printed on the invoice is a different one of your entities, the invoice still goes to entity_id and the disagreement is returned as entity_conflict. An id that is not one of your entities refuses that invoice; it is listed in errors. |
| buyer | object | optional | Who the invoice is addressed to, as printed on it. When entity_id is absent, it decides the entity against your entity register by the rules below — never by a guess. It does not change how a line is classified or what it emits. Fields below. |
| line_items | array | required | At least one line item per invoice |
| Field | Type | Description | |
|---|---|---|---|
| name | string | optional | Compared with each entity's legal name and the other names it is known by on invoices (set on the entity in your workspace settings), ignoring case, punctuation, legal forms (GmbH, AG, Sp. z o.o.) and umlaut spelling. If no entity matches, the invoice is stored with no entity; when one entity's name is clearly the closest, it is shown as a suggestion in Documents — it is never applied. |
| vat_id | string | optional | Compared with each entity's VAT / UID and registration number, ignoring spaces and punctuation. A match to one entity decides it and outranks the name; when two of your entities carry the same identifier, the name decides between them, or the invoice is stored with no entity. |
| customer_number | string | optional | Your customer number at the supplier. Recorded with the decision; not used to make it. |
| street, postal_code, city, country | string | optional | Accepted, not used to decide: an address does not say which legal entity bought. |
400 invalid_buyer, with field naming it.| Field | Type | Description | |
|---|---|---|---|
| description | string | required | Line item description. The classifier uses this to assign an emission factor. |
| spend_amount | number | required | Amount in invoice currency |
| quantity | number | optional | Physical quantity (kWh, kg, km, TEU, etc.) |
| unit_of_measure | string | optional | Unit label for quantity |
| weight_tonnes | number | optional | Weight in metric tonnes (for freight) |
| distance_km | number | optional | Distance in km (for freight/travel) |
{
"processed": 1,
"invoices": [
{
"invoice_id": "bb387bb1-a2a3-4933-af02-3475a7753a68",
"vendor_name": "Kuehne + Nagel AG",
"line_items_created": 2,
"total_kgco2e": 1287.40,
"entity_id": "5c1f0e2a-7d4b-4f6e-9a3c-2b8d1e0f4a71",
"entity_basis": "document_id",
"entity_conflict": false
}
],
"errors": []
}
Each invoice in the response carries entity_id, entity_basis and entity_conflict.
| Value | Meaning |
|---|---|
| explicit | You sent entity_id and it was used. entity_conflict is true when the buyer named a different one of your entities. |
| document_id | The buyer's VAT ID matched one, and only one, of your entities. |
| document_name | The buyer's name matched one, and only one, of your entities, by its legal name or one of its other names. When two of your entities share the buyer's VAT ID, the name only has to tell those two apart. |
| sole_entity | Your register holds one entity; every invoice is on it. |
| unresolved | The buyer matched none of your entities, or none was sent. Stored with no entity; it reads “Needs an entity” in Documents until someone assigns it. |
| ambiguous | The buyer matched more than one of your entities. Stored with no entity. |
| no_entities | Your workspace has not declared an entity register. |
{
"processed": 1,
"invoices": [{ ... }],
"errors": [
{
"index": 1,
"vendor_name": "Bad Invoice",
"error": "Missing invoice_date"
}
]
}
| Limit | Value |
|---|---|
| Invoices per request | 100 |
| Requests per minute, per workspace | 10 |
| HTTP | Meaning |
|---|---|
| 400 | Validation error (missing fields, empty array) |
| 401 | Missing or invalid API key |
| 429 | Rate limit exceeded |
| 500 | Server error (retry) |
| 503 | Your entity register could not be read, so nothing was written (retry) |
curl -X POST https://www.cobank.ai/api/ingest \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"invoices": [{
"vendor_name": "Office AG",
"invoice_date": "2026-04-01",
"total_amount": 1200,
"currency": "CHF",
"line_items": [{
"description": "Office supplies",
"spend_amount": 1200
}]
}]
}'
Auditor workpaper operations. Requires JWT authentication from an auditor account.
| Action | Description |
|---|---|
generate-sample | Create a risk-weighted sample (ISA 530) for an engagement |
save-assertion | Save/update a workpaper assertion on a line item |
re-perform | Re-run emission calculation for comparison |
complete | Mark engagement as completed (all items tested) |
export-evidence | Download evidence package as ZIP |
POST https://www.cobank.ai/api/workpaper
Authorization: Bearer <jwt>
Content-Type: application/json
{ "action": "export-evidence", "engagement_id": "UUID" }
Response: application/zip containing:
| File | Content |
|---|---|
metadata.json | Engagement details, period totals, testing summary |
workpapers.json | Per-item assertion status, risk scores, factor details |
audit-trail.json | SHA-256 hash chain entries for the period |
source-documents/*.pdf | Original invoices (if available, max 10) |
complete first.