Zum Inhalt springen

Step 2 of uploading a Beleg, receipt, invoice or E-Rechnung: put the files stored with file.store (pages: their hashes, in page order) into the inbox (Eingang) as one Beleg. Checks duplicates by file and content, opens a case and reads it: an E-Rechnung (XML, or a PDF with embedded XML) from its structure, anything else through the reading port if one is configured. Returns the case, its state and the Belegdaten read.

POST
/v1/commands/beleg.deliver
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/v1/commands/beleg.deliver \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "dry_run": false, "origin": { "display_name": "example", "id": "example", "kind": "example" }, "payload": { "betrieb_id": null, "channel": "app", "pages": [ "example" ], "skip_quality_check": false }, "rationale": "example" }'
Idempotency-Key
string

A repeated key returns the first result without running the Command again.

Decuma-Mandant
string format: uuid

The Mandant a session acts on; an API-Schlüssel is bound to its own.

Media typeapplication/json
object
dry_run

Dry run: the checks of executing, then the handler in a transaction that is always rolled back; nothing is logged, sent or kept. The answer is then a BefehlPruefung (as command.check) with the handler’s result as output, not the result below.

boolean
origin

Who or what a call comes from beyond its Actor, set by the caller (an automation, an integration): stored and hashed with the log entry, shown and filtered in the Verlauf.

object
display_name
required

The name a person reads in the Verlauf, 1 to 120 characters.

string
id
required

The caller’s own id of it, 1 to 200 characters.

string
kind
required

What kind of caller, 1 to 40 of a-z, 0-9 and _ (for example automation, integration).

string
payload
object
betrieb_id
string | null format: uuid
channel
string
default: api
Allowed values: app api
pages
required

The SHA-256 of the stored files (file.store), in page order.

Array<string>
skip_quality_check

Deliver pictures below the quality limits anyway: the Beleg is stored unread (the reading port is not asked) and its data is entered by hand.

boolean
rationale

Why the Actor issues this; stored in the Command-Log.

string

Result

Media typeapplication/json
object
beleg_id
required
string format: uuid
belegdaten
Any of:

One record of Belegdaten.

object
beleg_id
required
string format: uuid
felder
required

The fields of one Belegdaten record; a field that is absent was not read.

object
advance_invoice

The Beleg bills before the supply (Anzahlungsrechnung, Vorausrechnung): the period it names is the planned one.

Any of:
object
wert
required
boolean
zustand
required
string
Allowed values: gelesen bitte_pruefen
amount_charged

The amount charged by the card slip.

Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
aussteller
Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
aussteller_anschrift

Full address of the issuer.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
aussteller_steuernummer

The issuer’s Steuernummer (a USt-IdNr. read here moves to issuer_ust_idnr).

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
belegart
Any of:
object
wert
required
One of:
string
Allowed values: rechnung kleinbetragsrechnung fahrausweis vertrag sonstiges eigenbeleg lohnsteuerbescheinigung
zustand
required
string
Allowed values: gelesen bitte_pruefen
belegdatum
Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
brutto
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
corrects_invoice_number

The number of the invoice a credit note or correction refers to (E-Rechnung BT-25).

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
dispatch
Any of:
object
wert
required

What a printed dispatch day is about.

One of:

Goods sent on that day, delivered by the dispatch (§ 3 Abs. 6 UStG).

string
Allowed value: goods
zustand
required
string
Allowed values: gelesen bitte_pruefen
dispatched_on

The day the goods were sent, as printed (“Versandt am”), and what that day means.

Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
empfaenger

The recipient’s name.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
empfaenger_anschrift

The recipient’s address.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
invoice_type_code

The type code of an E-Rechnung (BT-3): 380 invoice, 381 credit note, 384 corrected invoice, 389 self-billed invoice.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
issuer_answer

The time of the supply comes from an earlier answer for the issuer: its question_id (issuer_answer.list), not from the Beleg.

Any of:
object
wert
required
string format: uuid
zustand
required
string
Allowed values: gelesen bitte_pruefen
issuer_country

The state of the issuer’s printed address, ISO 3166-1 alpha-2 (DE, IE, US); absent when the Beleg prints none. Never taken from the language, the currency or the number.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
issuer_ust_idnr

The issuer’s USt-IdNr. (§ 27a UStG), normalised.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
leistung

Quantity and kind of the goods, or extent and kind of the service.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
leistungsdatum
Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
lohnsteuerbescheinigung

A Lohnsteuerbescheinigung: the amounts by their number on the printout (“3”, “4”, “22a”, …).

object
key
additional properties
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
occasion

Occasion and participants of a Bewirtung as written on the bill (participants by comma).

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
order_email

The mail address the order came from, as printed.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
participants
Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
positions

The itemised positions as printed, when the reader gives them.

Array<object>

One itemised position of a Beleg as printed (a restaurant bill: each dish and drink), read beside the lines per rate; it books nothing itself, the checks read it.

object
brutto
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
drink

A person’s statement in a correction (beleg_data.correct): true when the position is a drink or anything but a dish, false when it is a dish. It decides over the recognition by name.

boolean | null
steuersatz
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
text
required
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
prepaid_credit

The Beleg buys credit that is taxed with the purchase: leistungsdatum is the day it was credited (absent: known only to lie in the month of the invoice); the period is the one of that month.

Any of:
object
wert
required
boolean
zustand
required
string
Allowed values: gelesen bitte_pruefen
rechnungsnummer
Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
recipient_ust_idnr

The number the Beleg prints as the recipient’s: its USt-IdNr. (E-Rechnung BT-48, recipient block) or its Steuernummer; never the issuer’s.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
reverse_charge_note

The Beleg prints the note that the recipient owes the tax (“Steuerschuldnerschaft des Leistungsempfängers”, “Reverse charge”, § 14a Abs. 5 Satz 1 UStG).

Any of:
object
wert
required
boolean
zustand
required
string
Allowed values: gelesen bitte_pruefen
service_charge

A service charge the restaurant adds, per rate (its amounts are part of zeilen too).

Array<object>
object
brutto
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
kategorie
Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
leistungsdatum

The line’s own day of the supply, when it differs from the Beleg’s.

Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
netto
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
steuer
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
steuersatz
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_from

The line’s own period of the supply, where the Beleg states an amount of its own for it (usage of the past month, the next month’s base fee). Several periods under one total are not split: leave them out and ask (missing_supply_date).

Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_to
Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
skonto

The agreed cash discount.

Any of:
object
wert
required

The agreed cash discount: prozent of the gross amount when paid within tage days of the Belegdatum (no tage: the terms state no period).

object
percent
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
tage
integer | null format: int64
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_date_as_invoice_date

The Beleg states that the day of the supply is the invoice date (“Leistungsdatum entspricht Rechnungsdatum”); on an invoice that is no E-Rechnung the reading sets the Leistungsdatum to the Belegdatum.

Any of:
object
wert
required
boolean
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_from

The period the Beleg prints for the supply (first day and last day, on any page or annex): the reading sets the Leistungsdatum to the last day. Not a planned period, and not the month that is only the subject of the work.

Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_period

The time of the supply as the Beleg names it when it names only the calendar month (YYYY-MM, § 31 Abs. 4 UStDV); the reading sets the period to its first and last day, the Leistungsdatum to the last one and supply_precision to month. --MM when the Beleg names its year nowhere for this supply: then it is asked. Not the month a payment was received.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_precision

Whether the Beleg prints the month or the days of the supply. Absent beside a period of exactly one calendar month: not known which (an E-Rechnung, BT-73 and BT-74).

Any of:
object
wert
required

What the Beleg prints as the time of the supply: the calendar month (its last day is computed) or days.

string
Allowed values: month days
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_sections

Several sections on one Beleg that states one total for them (usage in arrears and the next month’s base fee): their periods, in order.

Array<object>
object
first_day
required
string format: date
last_day
required
string format: date
supply_text

The time of the supply in the words of the Beleg.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_to
Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
tax_total_euro

The total tax in euro an E-Rechnung in another currency states beside it (BT-111 with BT-6 EUR).

Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
tip

A tip for the staff outside the tax lines; brutto is the total without it.

Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
tip_evidence

Where the tip is named: printed on the bill, receipted by the staff, or on the card slip.

Any of:
object
wert
required
string
Allowed values: printed receipted card_slip
zustand
required
string
Allowed values: gelesen bitte_pruefen
units

The units of the positions, each once: the codes of an E-Rechnung (BT-130), else as printed (Stunde, Tag, Woche, Monat, Jahr, kWh).

Array<string> | null
waehrung

ISO 4217 code of the amounts; absent is EUR.

Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
whole_month

A person’s answer where the Beleg names only the month: the supply covers the whole month (true), or was made on one day, the Leistungsdatum (false). Never read.

Any of:
object
wert
required
boolean
zustand
required
string
Allowed values: gelesen bitte_pruefen
zeilen
Array<object>
object
brutto
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
kategorie
Any of:
object
wert
required
string
zustand
required
string
Allowed values: gelesen bitte_pruefen
leistungsdatum

The line’s own day of the supply, when it differs from the Beleg’s.

Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
netto
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
steuer
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
steuersatz
Any of:
object
wert
required
string | number
/^-?\d+(\.\d+)?([eE]\d+)?$/
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_from

The line’s own period of the supply, where the Beleg states an amount of its own for it (usage of the past month, the next month’s base fee). Several periods under one total are not split: leave them out and ask (missing_supply_date).

Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
supply_to
Any of:
object
wert
required
string format: date
zustand
required
string
Allowed values: gelesen bitte_pruefen
id
required
string format: uuid
origin
required

Where each value of felder came from (aussteller, zeilen.0.netto, …): the oldest record of the unbroken run that holds the same value. A value a person kept as it was read keeps the reading as its origin; only a value the person changed or added is theirs.

object
key
additional properties

The record a value of the Belegdaten first appeared in.

object
entered_at
required
string format: date-time
entered_by
required
source
required

Person, port or struktur.

string
quelle
required

Person, port or struktur.

string
rationale
string | null
recorded_at
required
string format: date-time
recorded_by
required
replaced

The record this one corrects.

string | null format: uuid
case_id
string | null format: uuid
delivery_id
required
string format: uuid
dublette_von
string | null format: uuid
known
required

The same files (the same bytes, in the same order) were delivered before.

boolean
state
string | null

Example

{
"belegdaten": {
"felder": {
"advance_invoice": {
"zustand": "gelesen"
},
"amount_charged": {
"zustand": "gelesen"
},
"aussteller": {
"zustand": "gelesen"
},
"aussteller_anschrift": {
"zustand": "gelesen"
},
"aussteller_steuernummer": {
"zustand": "gelesen"
},
"belegart": {
"wert": "rechnung",
"zustand": "gelesen"
},
"belegdatum": {
"zustand": "gelesen"
},
"brutto": {
"zustand": "gelesen"
},
"corrects_invoice_number": {
"zustand": "gelesen"
},
"dispatch": {
"wert": "goods",
"zustand": "gelesen"
},
"dispatched_on": {
"zustand": "gelesen"
},
"empfaenger": {
"zustand": "gelesen"
},
"empfaenger_anschrift": {
"zustand": "gelesen"
},
"invoice_type_code": {
"zustand": "gelesen"
},
"issuer_answer": {
"zustand": "gelesen"
},
"issuer_country": {
"zustand": "gelesen"
},
"issuer_ust_idnr": {
"zustand": "gelesen"
},
"leistung": {
"zustand": "gelesen"
},
"leistungsdatum": {
"zustand": "gelesen"
},
"lohnsteuerbescheinigung": {
"additionalProperty": {
"zustand": "gelesen"
}
},
"occasion": {
"zustand": "gelesen"
},
"order_email": {
"zustand": "gelesen"
},
"participants": {
"zustand": "gelesen"
},
"positions": [
{
"brutto": {
"zustand": "gelesen"
},
"steuersatz": {
"zustand": "gelesen"
},
"text": {
"zustand": "gelesen"
}
}
],
"prepaid_credit": {
"zustand": "gelesen"
},
"rechnungsnummer": {
"zustand": "gelesen"
},
"recipient_ust_idnr": {
"zustand": "gelesen"
},
"reverse_charge_note": {
"zustand": "gelesen"
},
"service_charge": [
{
"brutto": {
"zustand": "gelesen"
},
"kategorie": {
"zustand": "gelesen"
},
"leistungsdatum": {
"zustand": "gelesen"
},
"netto": {
"zustand": "gelesen"
},
"steuer": {
"zustand": "gelesen"
},
"steuersatz": {
"zustand": "gelesen"
},
"supply_from": {
"zustand": "gelesen"
},
"supply_to": {
"zustand": "gelesen"
}
}
],
"skonto": {
"wert": {
"tage": null
},
"zustand": "gelesen"
},
"supply_date_as_invoice_date": {
"zustand": "gelesen"
},
"supply_from": {
"zustand": "gelesen"
},
"supply_period": {
"zustand": "gelesen"
},
"supply_precision": {
"wert": "month",
"zustand": "gelesen"
},
"supply_text": {
"zustand": "gelesen"
},
"supply_to": {
"zustand": "gelesen"
},
"tax_total_euro": {
"zustand": "gelesen"
},
"tip": {
"zustand": "gelesen"
},
"tip_evidence": {
"wert": "printed",
"zustand": "gelesen"
},
"waehrung": {
"zustand": "gelesen"
},
"whole_month": {
"zustand": "gelesen"
},
"zeilen": [
{
"brutto": {
"zustand": "gelesen"
},
"kategorie": {
"zustand": "gelesen"
},
"leistungsdatum": {
"zustand": "gelesen"
},
"netto": {
"zustand": "gelesen"
},
"steuer": {
"zustand": "gelesen"
},
"steuersatz": {
"zustand": "gelesen"
},
"supply_from": {
"zustand": "gelesen"
},
"supply_to": {
"zustand": "gelesen"
}
}
]
}
}
}

Problem

Media typeapplication/problem+json
object
code
required
string
Allowed values: validation not_authenticated not_allowed needs_human second_factor_required unknown_command idempotency_conflict not_found conflict busy internal
detail

What is wrong.

string
next_command

The Command the next step names, whatever the language of next_step.

string | null
next_step

What to do next.

string
retry_payload

Fields that complete the refused call when the refusal carries a proposal: merged into its payload, the same call goes through.

object | null
status
required
integer
title
required
string
type
required
string

Example

{
"code": "validation"
}