Skip to content

API reference

Make a final invoice draft

Invoicing API

POST/v1/final-invoices

Makes a final invoice draft that deducts the down payments of one contract, and saves it. Its type is 380, or 877 when construction is true or a down payment has type 875. Each down payment becomes a preceding invoice reference and a note line with its net amount, VAT and gross amount. Their gross sum is the paid amount (BT-113), which the amount due subtracts. The lines come from the draft draftId, such as the quote. Without it the draft has no lines and the form adds them. Only a down payment marked paid is deducted: a final invoice deducts the part payments received and their tax. All the paid down payments of reference are deducted unless downPaymentIds names some of them.

Headers

  • Idempotency-Keystring

    The same key and body again is answered with the first answer, and nothing is done twice. The same key with another body is 409 idempotency_key_reused; while the first is still being done, 409 request_in_progress. A key over 255 characters is 400 invalid_idempotency_key. Without a key, every request is done.

Request body

application/json, required

  • referencestringRequired
  • downPaymentIdsarray of string (uuid)
  • draftIdstring (uuid)
  • constructionboolean
  • languagestring

    The language of the note lines.

    One of de, en.

Response

A 201 answer carries these fields.

  • idstring (uuid)Required
  • revisionintegerRequired

    Counted up by every save. Send it as If-Match when you save the draft.

  • kindstringRequired
    One of invoice, quote, proforma.
  • titlestring or nullRequired

    The buyer's name and the invoice number, as far as the draft has them.

  • originobject or nullRequired

    The stored invoice a follow-up was made from. Null for a draft written from scratch.

    Show 2 child fields
    • invoiceIdstring (uuid)Required
    • followUpstringRequired
      One of copy, correction, credit, next, final.
  • createdAtstring (date-time)Required
  • updatedAtstring (date-time)Required
  • invoiceobjectRequired
  • settingsobjectRequired

Status codes

Status Meaning
201 The saved draft.
400
401
404
409 No down payment invoice names the reference (no_down_payments), none is marked paid or one named is not (down_payment_not_received), or one cannot be read (invoice_has_no_model, invoice_changed_since_check). A repeat with the same Idempotency-Key and another body (idempotency_key_reused), or while the first is still being done (request_in_progress; send it again in a moment). Nothing was done twice.
501
POST/v1/final-invoices
Example
curl -X POST https://api.certinvo.com/v1/final-invoices \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { readFile } from 'node:fs/promises'

const response = await fetch(`https://api.certinvo.com/v1/final-invoices`, {
  method: 'POST',
  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.post(
    "https://api.certinvo.com/v1/final-invoices",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
    data=open("body.json", "rb"),
)
print(response.status_code, response.text)
201
application/json
{
  "id": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
  "revision": 0,
  "kind": "invoice",
  "title": "string",
  "origin": {
    "invoiceId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
    "followUp": "copy"
  },
  "createdAt": "2026-09-17T09:30:00Z",
  "updatedAt": "2026-09-17T09:30:00Z",
  "invoice": {},
  "settings": {}
}
Success response
POST
/v1/final-invoices
Make a final invoice draft
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Headers2
›Bodyapplication/json
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/final-invoices" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "reference": "string",
  "downPaymentIds": [
    "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"
  ],
  "draftId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
  "construction": true,
  "language": "de"
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close