Zum Inhalt

Reference

Incoming invoices

GET/api/v1/incoming-invoicesList incoming invoices

Incoming (supplier) invoices as on /finanzen/eingangsrechnungen: supplier, their invoice number, invoice and due date, gross and still open in cents, the state (draft, open, partially_paid, overdue, paid), the areas (Bereiche, with their KOST) the cost shares name, and the DATEV hand-off state (offen, blockiert, uebergeben, im_paket or aus, with a reason where there is one). Without a status it lists the ones still to be paid. Drafts are proposals from the document intake or from an agent, waiting for a person to confirm them. Each item carries einvoice, null unless its file is an e-invoice: { format, legal, validation (pending, valid, invalid or unavailable), deviations } where deviations lists the saved values that differ from the e-invoice. Read only. finance.manage only.scope finance:read

Query

statusone of entwurf, offen, ueberfaellig, bezahlt, alleentwurf, offen (still to be paid, incl. overdue), ueberfaellig, bezahlt or alle. Default offen.
company_idstringOnly this supplier (search_companies).
querystringPart of the supplier, its name on a draft, or the invoice number.
limitintegerDefault 50, at most 200.

Response 200

items[]object[]
items[].idstring
items[].einvoiceobject | null
items[].einvoice.formatstring
items[].einvoice.legalboolean
items[].einvoice.validationone of pending, valid, invalid, unavailable
items[].einvoice.deviations[]object[]
items[].supplierstring | null
items[].supplier_invoice_numberstring | null
items[].invoice_datestring
items[].due_datestring
items[].gross_centsinteger
items[].open_centsinteger
items[].stateone of draft, open, partially_paid, paid, initiated, overdue, cancelled
items[].document_urlstring | null
items[].areas[]object[]
items[].areas[].idstring
items[].areas[].namestring
items[].areas[].cost_centerstring | null
items[].datevobject
items[].datev.stateone of offen, blockiert, uebergeben, im_paket, aus
items[].datev.reasonoptionalstring
Schema
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "einvoice": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string"
                  },
                  "legal": {
                    "type": "boolean"
                  },
                  "validation": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "valid",
                      "invalid",
                      "unavailable"
                    ]
                  },
                  "deviations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "enum": [
                            "grossCents",
                            "netCents",
                            "vatCents",
                            "supplierInvoiceNumber",
                            "invoiceDate",
                            "dueDate"
                          ]
                        },
                        "stored": {
                          "type": [
                            "string",
                            "number",
                            "null"
                          ]
                        },
                        "eInvoice": {
                          "type": [
                            "string",
                            "number",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "field",
                        "stored",
                        "eInvoice"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "format",
                  "legal",
                  "validation",
                  "deviations"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "supplier": {
            "type": [
              "string",
              "null"
            ]
          },
          "supplier_invoice_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_date": {
            "type": "string"
          },
          "due_date": {
            "type": "string"
          },
          "gross_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "open_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "open",
              "partially_paid",
              "paid",
              "initiated",
              "overdue",
              "cancelled"
            ]
          },
          "document_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "areas": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "cost_center": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "cost_center"
              ],
              "additionalProperties": false
            }
          },
          "datev": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "offen",
                  "blockiert",
                  "uebergeben",
                  "im_paket",
                  "aus"
                ]
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "state"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "einvoice",
          "supplier",
          "supplier_invoice_number",
          "invoice_date",
          "due_date",
          "gross_cents",
          "open_cents",
          "state",
          "document_url",
          "areas",
          "datev"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "items"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

POST/api/v1/incoming-invoicesCreate incoming invoice draft

Proposes an incoming (supplier) invoice as a draft (optionally from an uploaded XML e-invoice, see attachment_id) for a person to check and confirm on /finanzen/eingangsrechnungen. A draft is not payable, books nothing and is not in the liquidity forecast until it is confirmed; confirming, cancelling, payments and matching bank transactions are not available here. Name the supplier by company_id or, when it is not a Firma yet, by supplier_name; on confirmation a name is matched to the Firma of that name or becomes a new supplier Firma. Give a cost category, or a purchase contract line with the period it bills. Amounts in cents (the gross of a share in euros); the area is business_unit_id or a split in shares, kept on confirmation; due_date defaults to the supplier's payment term.scope finance:write

Body (JSON)

company_idstringThe supplier Firma, if it exists.
supplier_namestringThe supplier's name when it is not a Firma yet; confirming makes it one.
attachment_idstringAn XML e-invoice or other invoice file from upload_attachment. Missing fields default from an e-invoice; explicit arguments win and differences are listed in the result.
supplier_invoice_numberstringThe number printed on the supplier's invoice. Required without an e-invoice in attachment_id.
invoice_datestringRequired without an e-invoice in attachment_id.
due_datestringDefault: invoice date plus the supplier's payment term.
gross_centsintegerRequired without an e-invoice in attachment_id.
net_centsintegerGive net and vat together; they add up to gross.
vat_centsinteger
ibanstringThe supplier's IBAN as printed.
category_keystringA cost category (list_finance_categories). Not needed with a contract period.
contract_line_idstringA purchase contract line of the supplier, with period_from.
period_fromstringFirst day of the period the invoice bills.
business_unit_idstringThe area (Bereich) the whole invoice belongs to: its id or name (list_business_units). Give this or shares. Without either the area is derived from the supplier and contract.
shares[]object[]A split over several areas, one entry per area; the gross amounts must add up to the invoice's gross.
shares[].business_unit_idrequiredstring
shares[].grossrequirednumberGross of this share in euros.

Response 200

idstring
statestring
supplierstring | null
gross_centsinteger
einvoiceobject | null
einvoice.formatstring
einvoice.legalboolean
einvoice.validationone of pending, valid, invalid, unavailable
einvoice.deviations[]object[]
einvoice.deviations[].fieldone of grossCents, netCents, vatCents, supplierInvoiceNumber, invoiceDate, dueDate
einvoice.deviations[].storedstring | number | null
einvoice.deviations[].eInvoicestring | number | null
urlstring
nextstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "state": {
      "type": "string",
      "const": "draft"
    },
    "supplier": {
      "type": [
        "string",
        "null"
      ]
    },
    "gross_cents": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "einvoice": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "format": {
              "type": "string"
            },
            "legal": {
              "type": "boolean"
            },
            "validation": {
              "type": "string",
              "enum": [
                "pending",
                "valid",
                "invalid",
                "unavailable"
              ]
            },
            "deviations": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string",
                    "enum": [
                      "grossCents",
                      "netCents",
                      "vatCents",
                      "supplierInvoiceNumber",
                      "invoiceDate",
                      "dueDate"
                    ]
                  },
                  "stored": {
                    "type": [
                      "string",
                      "number",
                      "null"
                    ]
                  },
                  "eInvoice": {
                    "type": [
                      "string",
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "field",
                  "stored",
                  "eInvoice"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "format",
            "legal",
            "validation",
            "deviations"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "type": "string"
    },
    "next": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "state",
    "supplier",
    "gross_cents",
    "einvoice",
    "url",
    "next"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

GET/api/v1/incoming-invoices/{id}Get incoming invoice

One incoming (supplier) invoice by id (from list_incoming_invoices): supplier, their number, dates, gross and open in cents, the state, and its payments -- id, paid_on, amount_cents, note, origin (hand: recorded by hand; bank: from a bank transaction; reversal: an undone bank booking), bank_transaction_id (the transaction behind it or coupled to it, else null) and cancelled ({ on, by, reason } or null). payment_order is the initiated SEPA payment order, or null. Read only. finance.manage only.scope finance:read

Path

idrequiredstringThe incoming invoice's id.

Response 200

idstring
supplierstring | null
supplier_invoice_numberstring | null
invoice_datestring
due_datestring
gross_centsinteger
open_centsinteger
stateone of draft, open, partially_paid, paid, initiated, overdue, cancelled
payments[]object[]
payments[].idstring
payments[].paid_onstring
payments[].amount_centsinteger
payments[].notestring | null
payments[].originone of hand, bank, reversal, cancellation
payments[].bank_transaction_idstring | null
payments[].cancelledobject | null
payments[].cancelled.onstring
payments[].cancelled.bystring
payments[].cancelled.reasonstring
payment_orderobject | null
payment_order.idstring
payment_order.statusstring
payment_order.amount_centsinteger
payment_order.created_onstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "supplier": {
      "type": [
        "string",
        "null"
      ]
    },
    "supplier_invoice_number": {
      "type": [
        "string",
        "null"
      ]
    },
    "invoice_date": {
      "type": "string"
    },
    "due_date": {
      "type": "string"
    },
    "gross_cents": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "open_cents": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "state": {
      "type": "string",
      "enum": [
        "draft",
        "open",
        "partially_paid",
        "paid",
        "initiated",
        "overdue",
        "cancelled"
      ]
    },
    "payments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "paid_on": {
            "type": "string"
          },
          "amount_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "hand",
              "bank",
              "reversal",
              "cancellation"
            ]
          },
          "bank_transaction_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "cancelled": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "on": {
                    "type": "string"
                  },
                  "by": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "on",
                  "by",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "paid_on",
          "amount_cents",
          "note",
          "origin",
          "bank_transaction_id",
          "cancelled"
        ],
        "additionalProperties": false
      }
    },
    "payment_order": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "const": "initiated"
            },
            "amount_cents": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "created_on": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "status",
            "amount_cents",
            "created_on"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "supplier",
    "supplier_invoice_number",
    "invoice_date",
    "due_date",
    "gross_cents",
    "open_cents",
    "state",
    "payments",
    "payment_order"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.