Skip to content

Connections · How-to guide

Send an invoice by email

Learn how to email one file of a stored invoice to one address, from the API or the console.

You can send one file of a stored invoice to one email address, as an attachment. The address can be a buyer, their accounts office, or a public invoice portal that takes email. This guide shows the request, the console form, the email’s words, and what each refusal means.

Before you begin

  • You need the invoice’s invoiceId.
  • The deployment needs an email provider. Without one, every send is refused with 503.

Send from the API

curl -s \
  -H "Authorization: Bearer cvo_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"to": "[email protected]", "format": "zugferd-pdf"}' \
  "https://<api-host>/v1/invoices/<id>/emails"

The body has two fields and no others:

  • to is one email address.
  • format is one invoice file: original, ubl, cii, zugferd-pdf, peppol, en16931-ubl, en16931-cii, factur-x, extended-cii or zugferd-extended.

A DATEV file is bookkeeping, not an invoice file, so you cannot email it.

When the invoice was made for a customer that is delivered by email, or with an email delivery chosen for it, you may leave out to, format or both. The invoice’s deliveryPlan fills them in, with the address and the file it was filed with. Without such a plan, a body that leaves one out is refused with 400 invalid_email. See Give a customer its files and delivery.

The answer is 202 with the email provider’s id:

{ "emailId": "…", "to": "[email protected]", "format": "zugferd-pdf" }

202 means the email provider accepted the email. It does not mean the buyer’s mail server received it. To learn that, see Check that it arrived.

Send it once

Send an Idempotency-Key header with any text of 1 to 255 characters, such as a new UUID. A retry with the same key and the same body is answered with the first email, and nothing is sent again. The email provider gets a key of its own from it, so a retry after an answer that was lost on the way is still one email to the buyer.

  • The same key with another body is refused with 409 idempotency_key_reused.
  • The same key while the first send is still being done is refused with 409 request_in_progress. Send it again in a moment.
  • Without a key, every request sends an email.

Send from the console

  1. On an invoice row, open Versenden.
  2. Under E-Mail / Behörden-Portal, type the address.
  3. Choose one of the files this invoice has.
  4. Press Per E-Mail senden.

The row then says, with a tick, who the email went to. When the API refuses the send, the row says why in the console’s language, chosen by the refusal’s code.

The console sends each email with an Idempotency-Key. A second press after no answer, or after a refusal, carries the same key, so it is one email. Once a send succeeded, the next press of the same file to the same address is a new email.

An invoice you made also has a Zustellung tab on its invoice page. It holds the same email form, the webhook form, and a download of each file for a portal you upload to by hand. An invoice made for a customer shows its plan first, and the email form starts with the planned address and file. When none of the invoice’s files may leave, the tab says delivery is blocked and offers nothing. After an email is sent the page reads the invoice again, so its history shows the send at once. The list’s Send menu and this tab draw one card: email, then webhook, then (on the tab) the downloads, and one quiet line naming the channels coming soon, Peppol and DATEV. A version an edit replaced has no Zustellung tab: its page says it was replaced and links the newest version, which is the one you send.

Send by itself

You can let an invoice be emailed by itself once its check is filed. It is off until you turn it on.

  • In the console: open Einstellungen, then Rechnungen, then E-Mail-Versand. The third part is Automatisch senden. Before you save, it lists each customer and says where its invoices will go, or why they wait.
  • Through the API: GET and PUT /v1/sending with { "mode", "verdicts", "duplicates" }. A signed-in person or an API key may save it, so a platform can set it for each of its companies.
{ "mode": "automatic", "verdicts": ["clean", "acceptable-with-findings"], "duplicates": "send" }
  • mode is by-hand (the default) or automatic.
  • verdicts is ["clean", "acceptable-with-findings"] (the default) or ["clean"]. An invoice the validator accepts with findings is usable, so it goes unless you choose ["clean"]. A rejected invoice is never sent. Anything else is refused with 400 invalid_sending.
  • duplicates is send (the default) or hold. send lets a likely duplicate go, its warning kept on the invoice; hold keeps it until a person keeps or dismisses it. Both are Certinvo checks, not legal requirements: they hold an invoice only when you choose so.

An invoice is sent by itself only when all of these hold:

  1. Its delivery is by email: the customer’s, or one chosen for the invoice. A portal always waits for a person. So does Peppol: no access point is connected yet, and the Sending preview says so for that customer.
  2. That delivery says "sending": "automatic", or it says nothing and the setting is automatic.
  3. Its verdict is one of verdicts.
  4. It is not a likely duplicate, or duplicates is send. Keeping a held one sends it then.

The setting is copied into the invoice’s deliveryPlan as sending when the invoice is filed. A change applies from the next invoice. It never sends, or holds back, an invoice already filed. A later re-check never sends one either.

The email goes to the address and file in the plan, with the same letter and the same rules as a send from the API. Its history line api:emailed carries "automatic": true. The invoice answers how it went as sending:

sending.state Meaning
pending Waiting for its next attempt. A refused attempt is tried again after 1, 4, 16, 64 and 256 minutes.
sent The email provider accepted it.
failed It will not be tried again. error says why: six refusals, or the file may not leave. The history gets api:sending-failed, which a webhook hears. Send it by hand.

Each invoice is queued once, so it is never sent twice by itself. Every attempt for one invoice carries the same key to the email provider, so an attempt repeated after a lost answer is still one email. On the invoice page, the Zustellung tab says whether the invoice goes by itself and how that went. A failed sending shows its error as the server wrote it, in English, marked “The server said, in English: …”.

Mail invoices to your send address

Your software already makes the invoice file. You can mail that file to your send address, and Certinvo checks it and emails it to the buyer. An invoice that does not pass never reaches the buyer.

Set it up

  1. In the console, open Einstellungen, then Rechnungen, then E-Mail-Versand. The send address is the page’s second part, Rechnungen per E-Mail versenden.
  2. Under Wer versenden darf, write your own people, one per line: an address such as [email protected], or your domain such as @ihre-firma.de.
  3. Choose Absender speichern. The first save creates your send address and shows it above the list.

To add many people at once, choose Importieren und exportieren beside Absender speichern. It downloads the list, or a sample, as CSV, Excel or JSON, one column sender, and imports a file: the block shows what the file would add before you choose to import. An import only adds; it never removes anyone from the list.

Through the API, GET and PUT /v1/email-inbox/send work as /v1/email-inbox does, and /v1/data-files/email-send-senders as /v1/data-files/email-inbox-senders. Only a signed-in person can save the list, because these senders make invoices leave in your name.

This list is apart from the list of your receive address. A supplier who may send you invoices can never send one out through your send address.

Who may use it

A mail is accepted only when both of these hold:

  • Its sender is on the list.
  • Its mail server signed it, and the email provider confirmed the signature: DKIM or DMARC pass. Without that, anyone could write your address into a mail’s From line.

A mail that fails either is not filed. It shows in Ausgang, tab Nicht angenommen, as Absender nicht freigegeben or E-Mail nicht vom Server des Absenders signiert. A signed-in person can still let it through there with Absender erlauben und ablegen.

What happens to each invoice

Each XML or PDF e-invoice in the mail is filed in Ausgang as your own invoice and checked. Then exactly one of these happens:

The invoice What happens
Passed, and an address is known It is emailed to the buyer, as the very file you mailed.
Rejected by the check It is not sent. You get an email saying so.
A likely duplicate, and your setting holds duplicates It is not sent. You get an email saying so.
A likely duplicate, and your setting sends duplicates It is emailed to the buyer, and the warning stays on the invoice.
Accepted with findings, and you send only clean invoices by themselves It waits for you. You get an email saying so.
For a buyer set to be sent to by hand It waits for you. You get an email saying so.
No address is known It is not sent. You get an email saying so.

The buyer’s address is found in this order:

  1. The email address in the invoice: the Buyer electronic address (BT-49) when its scheme is EM.
  2. The address saved for that buyer. The buyer is found by the invoice’s VAT ID (BT-48), buyer reference (BT-10, such as a Leitweg-ID) or electronic address (BT-49). It must match exactly one saved buyer.

Which verdicts go by themselves is your Automatisch senden setting (see Send by itself): only clean invoices, unless you chose clean ones and ones with findings. Mailing an invoice to the send address is the instruction to send it, so it goes even while that setting is by hand.

The email to the buyer, and the email telling you an invoice was held, go through the same queue as Send by itself, with the same retries. The note to you goes to the address that mailed the invoice. A PDF with no e-invoice inside cannot be read, so nothing is filed from it.

What is sent

  • The file. It is the file the download hands out for the same format, sent only when the invoice’s newest check accepts it. A file you cannot download is not sent either. An invoice already sent stays downloadable on the check it was sent with, but sending it again needs the newest check.
  • The file’s name. It is your file name pattern with the file’s extension. Without a pattern, it is the invoice number. A [date] in the pattern is the day the email is sent, in your company’s time zone.
  • The subject and text. These are your own words when you saved a template (see below). Otherwise they are a short letter in the invoice’s own language, the language its page prints in: German “Rechnung” and the invoice number as the subject, or “Invoice” in English, “Facture” in French. The text names the invoice number and the seller, as the invoice states them. An invoice filed before it kept a language is written in your company’s.
  • The sender. The email comes from the deployment’s own address.
  • The reply address. On an invoice you sent, a reply goes to the Seller contact email address (BT-43) on the invoice. Without one, and on an invoice somebody sent you, it goes to the deployment’s reply address.

Each email sent adds a line api:emailed to the invoice’s history. The line holds the format, the address, the provider’s id and who sent it. A refused send adds nothing.

Change the words

You can replace the default subject and text with your own.

  • In the console: open Einstellungen, then Rechnungen, then E-Mail-Versand; the text is the page’s second part, under the inbox.
  • Through the API: GET and PUT /v1/email-template with { "subject", "body" }.

Any key can read the template. Only a signed-in person can save one, because these words go to buyers under your name. The subject holds up to 200 characters and the text up to 5,000. Each save keeps the earlier version.

Both the subject and the text may use these fields. Each is filled from the invoice being sent:

Field Filled with
{{rechnungsnummer}} The invoice number
{{verkaeufer}} The seller’s name
{{kaeufer}} The buyer’s name
{{betrag}} The amount due with its currency, such as 1.190,50 €
{{faellig}} The due date, such as 15.10.2026

The amount and the date are written as the invoice’s page writes them: 1.190,50 € and 15.10.2026 on a German invoice, 1,190.50 EUR and 2026-10-15 on an English one. Your own words are sent as you wrote them, whatever the invoice’s language. A fact the invoice does not state leaves its field empty. A field not on this list is refused when you save, so a typo never reaches a buyer.

Check that it arrived

The email provider reports what happens after 202. Each report adds one more line to the invoice’s history:

Line Meaning
api:email-delivered The buyer’s mail server accepted it.
api:email-delayed Delivery is slow. The provider keeps trying.
api:email-bounced The buyer’s server refused it. The line says why, such as a mailbox that does not exist.
api:email-complained The buyer marked it as spam.
api:email-failed or api:email-suppressed It was not sent at all.

These reports need the provider to reach the API. They appear only on a deployment with a public address.

When a send is refused

Nothing is sent in any of these cases.

Status Code Meaning
400 invalid_json The body is not JSON.
400 invalid_email The body is not one address and one invoice file, or names another field.
404 unknown_invoice This company has no such invoice, or no file of that format.
409 invoice_rejected, invoice_not_validated, invoice_changed_since_check The file may not leave, for the same reason the download gives.
409 conversion_would_be_incomplete The requested syntax cannot hold this invoice.
409 invoice_replaced An edit replaced this version. The message names the newest version; send that one.
502 email_not_sent The email provider refused the email or could not be reached. The message gives its reason.
503 email_not_configured This deployment has no email provider set up.

The full list is on API error codes.

See also

Navigation

Type to search…

↑↓ navigate↵ selectEsc close