---
title: "Create a new invoice"
method: POST
path: "/Invoice/Factory/saveInvoice"
tags: ["Invoice"]
---

# Create a new invoice

`POST /Invoice/Factory/saveInvoice`

This endpoint offers you the following functionality.
     <ul>
        <li>Create invoices together with positions and discounts</li>
        <li>Delete positions while adding new ones</li>
        <li>Delete or add discounts, or both at the same time</li>
        <li>Automatically fill the address of the supplied contact into the invoice address</li>
     </ul>
     To make your own request sample slimmer, you can omit all parameters which are not required and nullable.
     However, for a valid and logical bookkeeping document, you will also need some of them to ensure that all the necessary data is in the invoice.<br><br> The list of parameters starts with the invoice array.<br> This array contains all required attributes for a complete invoice.<br> Most of the attributes are covered in the invoice attribute list, there are only two parameters standing out, namely <b>mapAll</b> and <b>objectName</b>.<br> These are just needed for our system and you always need to provide them.<br><br> The list of parameters then continues with the invoice position array.<br> With this array you have the possibility to add multiple positions at once.<br> In the example it only contains one position, again together with the parameters <b>mapAll</b> and <b>objectName</b>, however, you can add more invoice positions by extending the array.<br> So if you wanted to add another position, you would add the same list of parameters with an incremented array index of "1" instead of "0".<br><br> The list ends with the four parameters invoicePosDelete, discountSave, discountDelete and takeDefaultAddress.<br> They only play a minor role if you only want to create an invoice but we will shortly explain what they can do.<br> With invoicePosDelete you have to option to delete invoice positions as this request can also be used to update invoices.<br> With discountSave you can add discounts to your invoice.<br> With discountDelete you can delete discounts from your invoice.<br> With takeDefaultAddress you can specify that the first address of the contact you are using for the invoice is taken for the invoice address attribute automatically, so you don't need to provide the address yourself.<br> If you want to know more about these parameters, for example if you want to use this request to update invoices, feel free to contact our support.<br><br> Finally, after covering all parameters, they only important information left, is that the order of the last four attributes always needs to be kept.<br> You will also always need to provide all of them, as otherwise the request won't work properly.<br><br> <b>Warning:</b> You can not create a regular invoice with the <b>deliveryDate</b> being later than the <b>invoiceDate</b>.<br> To do that you will need to create a so called <b>Abschlagsrechnung</b> by setting the <b>invoiceType</b> parameter to <b>AR</b>.

## Request body

- SaveInvoice
  - `invoice` ModelInvoice, required — Invoice model
    - `id` integer, nullable — The invoice id. <span style='color:red'>Required</span> if you want to create or update an invoice position for an existing invoice
    - `objectName` string — The invoice object name.
    - `invoiceNumber` string, nullable — The invoice number
    - `contact` object, required — The contact used in the invoice
      - `id` integer, required — Unique identifier of the contact
      - `objectName` string, required — Model name, which is 'Contact'
    - `contactPerson` object, required — The user who acts as a contact person for the invoice
      - `id` integer, required — Unique identifier of the user
      - `objectName` string, required — Model name, which is 'SevUser'
    - `create` string, date-time — Date of invoice creation
    - `update` string, date-time — Date of last invoice update
    - `sevClient` object — Client to which invoice belongs. Will be filled automatically
      - `id` integer, required — Unique identifier of the client
      - `objectName` string, required — Model name, which is 'SevClient'
    - `invoiceDate` string, required — Needs to be provided as timestamp or dd.mm.yyyy **Requirements:** * For final invoices (invoiceType = 'ER'), the invoiceDate must be later than or equal to the invoiceDate of related advance (invoiceType = 'AR') / partial (invoiceType = 'TR') invoices.</li>
    - `header` string, nullable — Normally consist of prefix plus the invoice number
    - `headText` string, nullable — Certain html tags can be used here to format your text
    - `footText` string, nullable — Certain html tags can be used here to format your text
    - `timeToPay` integer, nullable — The time the customer has to pay the invoice in days
    - `discount` integer, required — If you want to give a discount, define the percentage here. Otherwise provide zero as value
    - `address` string, nullable — Complete address of the recipient including name, street, city, zip and country. * Line breaks can be used and will be displayed on the invoice pdf.
    - `addressCountry` object, required — Can be omitted as complete address is defined in address attribute
      - `id` integer, required — Unique identifier of the country
      - `objectName` string, required — Model name, which is 'StaticCountry'
    - `payDate` string, date-time, nullable — Needs to be timestamp or dd.mm.yyyy
    - `createUser` object — Will be filled automatically by our system and can't be changed
      - `id` integer, required — Unique identifier of the user
      - `objectName` string, required — Model name, which is 'SevUser'
    - `deliveryDate` string, date-time, nullable — Timestamp. This can also be a date range if you also use the attribute deliveryDateUntil
    - `deliveryDateUntil` integer, nullable — If the delivery date should be a time range, another timestamp can be provided in this attribute * to define a range from timestamp used in deliveryDate attribute to the timestamp used here.
    - `status` '50' | '100' | '200' | '750' | '1000', required — Please have a look in our <a href='#tag/Invoice/Types-and-status-of-invoices'>Types and status of invoices</a> to see what the different status codes mean
    - `smallSettlement` boolean, nullable — Defines if the client uses the small settlement scheme. If yes, the invoice must not contain any vat
    - `taxRate` number, float, required — This is not used anymore. Use the taxRate of the individual positions instead.
    - `taxRule` object, required — **Use this in sevdesk-Update 2.0 (replaces taxType / taxSet).** See [list of available VAT rules](#section/sevdesk-Update-2.0/Tax-Rules).
      - `id` '1' | '2' | '3' | '4' | '5' | '11' | '17' | '18' | '19' | '20' | '21', required
      - `objectName` 'TaxRule', required — Name of the object. Must always be TaxRule
    - `taxText` string, required — A common tax text would be 'Umsatzsteuer 19%'
    - `taxType` 'default' | 'eu' | 'noteu' | 'custom', required — **Use this in sevdesk-Update 1.0 (instead of taxRule).** Tax type of the invoice. There are four tax types: 1. default - Umsatzsteuer ausweisen 2. eu - Steuerfreie innergemeinschaftliche Lieferung (Europäische Union) 3. noteu - Steuerschuldnerschaft des Leistungsempfängers (außerhalb EU, z. B. Schweiz) 4. custom - Using custom tax set 5. ss - Not subject to VAT according to §19 1 UStG Tax rates are heavily connected to the tax type used.
    - `taxSet` object, nullable — **Use this in sevdesk-Update 1.0 (instead of taxRule).** Tax set of the invoice. Needs to be added if you chose the tax type custom
      - `id` string, required — Unique identifier of the object
      - `objectName` string, required — Model name, which is 'TaxSet'
    - `dunningLevel` integer, nullable — Defines how many reminders have already been sent for the invoice. Starts with 1 (Payment reminder) and should be incremented by one every time another reminder is sent.
    - `paymentMethod` object — Payment method used for the invoice
      - `id` integer, required — Unique identifier of the payment method
      - `objectName` string, required — Model name, which is 'PaymentMethod'
    - `sendDate` string, date-time, nullable — The date the invoice was sent to the customer
    - `invoiceType` 'RE' | 'WKR' | 'SR' | 'MA' | 'TR' | 'AR' | 'ER', required — Type of the invoice. For more information on the different types, check <a href='#tag/Invoice/Types-and-status-of-invoices'>this</a> section
    - `accountIntervall` string, nullable — The interval in which recurring invoices are due as ISO-8601 duration.<br> Necessary attribute for all recurring invoices.
    - `accountNextInvoice` integer, nullable — Timestamp when the next invoice will be generated by this recurring invoice.
    - `currency` string, required — Currency used in the invoice. Needs to be currency code according to ISO-4217
    - `sumNet` number, float — Net sum of the invoice
    - `sumTax` number, float — Tax sum of the invoice
    - `sumGross` number, float — Gross sum of the invoice
    - `sumDiscounts` number, float — Sum of all discounts in the invoice
    - `sumNetForeignCurrency` number, float — Net sum of the invoice in the foreign currency
    - `sumTaxForeignCurrency` number, float — Tax sum of the invoice in the foreign currency
    - `sumGrossForeignCurrency` number, float — Gross sum of the invoice in the foreign currency
    - `sumDiscountsForeignCurrency` number, float — Discounts sum of the invoice in the foreign currency
    - `sumNetAccounting` number, float — Net accounting sum of the invoice. Is usually the same as sumNet
    - `sumTaxAccounting` number, float — Tax accounting sum of the invoice. Is usually the same as sumTax
    - `sumGrossAccounting` number, float — Gross accounting sum of the invoice. Is usually the same as sumGross
    - `paidAmount` number, float, nullable — Amount which has already been paid for this invoice by the customer
    - `showNet` boolean — If true, the net amount of each position will be shown on the invoice. Otherwise gross amount
    - `enshrined` string, date-time — Enshrined invoices cannot be changed. Can only be set via [Invoice/{invoiceId}/enshrine](#tag/Invoice/operation/invoiceEnshrine). This operation cannot be undone.
    - `sendType` 'VPR' | 'VPDF' | 'VM' | 'VP', nullable — Type which was used to send the invoice.
    - `origin` object, nullable — Origin of the invoice. Could f.e. be an order
      - `id` string, required — Unique identifier of the object
      - `objectName` string, required — Model name, which could be 'Order'
    - `customerInternalNote` string, nullable — Internal note of the customer. Contains data entered into field 'Referenz/Bestellnummer'
    - `propertyIsEInvoice` boolean, nullable — If true, the invoice will be created as e-invoice. To create a valid e-invoice some extra data are required - sevClient - addressStreet - addressZip - addressCity - bankIban - bankBic - contactEmail - contactPhone - taxNumber - vatNumber - contact - buyerReference - email - invoice - paymentMethod - addressStreet - addressZip - addressCity - addressCountry - contact
    - `mapAll` boolean, required
  - `invoicePosSave` ModelInvoicePos[]
    - `id` integer — The invoice position id. <span style='color:red'>Required</span> if you want to update an invoice position for an existing invoice
    - `objectName` string, required — The invoice position object name
    - `mapAll` boolean, required
    - `create` string, date-time — Date of invoice position creation
    - `update` string, date-time — Date of last invoice position update
    - `invoice` object — The invoice to which the position belongs.
      - `id` integer, required — Unique identifier of the invoice
      - `objectName` string, required — Model name, which is 'Invoice'
    - `part` object — Part from your inventory which is used in the position.
      - `id` integer, required — Unique identifier of the part
      - `objectName` string, required — Model name, which is 'Part'
    - `quantity` number, float, required — Quantity of the article/part
    - `price` number, float, nullable — Price of the article/part. Is either gross or net, depending on the sevdesk account setting.
    - `name` string, nullable — Name of the article/part.
    - `unity` object, required — The unit in which the positions part is measured
      - `id` integer, required — Unique identifier of the unit
      - `objectName` string, required — Model name, which is 'Unity'
    - `sevClient` object — Client to which invoice position belongs. Will be filled automatically
      - `id` integer, required — Unique identifier of the client
      - `objectName` string, required — Model name, which is 'SevClient'
    - `positionNumber` integer, nullable — Position number of your position. Can be used to order multiple positions.
    - `text` string, nullable — A text describing your position.
    - `discount` number, float, nullable — An optional discount of the position.
    - `taxRate` number, float, required — Tax rate of the position.
    - `sumDiscount` number, float, nullable — Discount sum of the position
    - `sumNetAccounting` number, float, nullable — Net accounting sum of the position
    - `sumTaxAccounting` number, float, nullable — Tax accounting sum of the position
    - `sumGrossAccounting` number, float, nullable — Gross accounting sum of the position
    - `priceNet` number, float, nullable — Net price of the part
    - `priceGross` number, float, nullable — Gross price of the part
    - `priceTax` number, float, nullable — Tax on the price of the part
  - `invoicePosDelete` object
    - `id` integer, required — Id of invoice position
    - `objectName` string, required — Object name of invoice position
  - `filename` string, binary — Filename of a previously upload file which should be attached.
  - `discountSave` object[]
    - `discount` boolean — Defines if this is a discount or a surcharge
    - `text` string — A text for your discount
    - `percentage` boolean — Defines if this is a percentage or an absolute discount
    - `value` number — Value of the discount
    - `objectName` string — Object name of the discount
    - `mapAll` boolean — Internal param
  - `discountDelete` object
    - `id` integer — ID of discount to delete
    - `objectName` string — Object name of discount

## Response `201`

Created - Returns created invoice

- SaveInvoiceResponse
  - `invoice` ModelInvoiceResponse — Invoice model
    - `id` string — The invoice id
    - `objectName` string — The invoice object name
    - `invoiceNumber` string — The invoice number
    - `contact` object — The contact used in the invoice
      - `id` string, required — Unique identifier of the contact
      - `objectName` string, required — Model name, which is 'Contact'
    - `create` string, date-time — Date of invoice creation
    - `update` string, date-time — Date of last invoice update
    - `sevClient` object — Client to which invoice belongs. Will be filled automatically
      - `id` string, required — Unique identifier of the client
      - `objectName` string, required — Model name, which is 'SevClient'
    - `invoiceDate` string — The invoice date.
    - `header` string — Normally consist of prefix plus the invoice number
    - `headText` string — Certain html tags can be used here to format your text
    - `footText` string — Certain html tags can be used here to format your text
    - `timeToPay` string — The time the customer has to pay the invoice in days
    - `discountTime` string — If a value other than zero is used for the discount attribute, you need to specify the amount of days for which the discount is granted.
    - `discount` string — If you want to give a discount, define the percentage here. Otherwise provide zero as value
    - `addressCountry` object — Can be omitted as complete address is defined in address attribute
      - `id` string, required — Unique identifier of the country
      - `objectName` string, required — Model name, which is 'StaticCountry'
    - `payDate` string, date-time — Needs to be timestamp or dd.mm.yyyy
    - `createUser` object — Will be filled automatically by our system and can't be changed
      - `id` string, required — Unique identifier of the user
      - `objectName` string, required — Model name, which is 'SevUser'
    - `deliveryDate` string, date-time — Timestamp. This can also be a date range if you also use the attribute deliveryDateUntil
    - `status` '50' | '100' | '200' | '750' | '1000' — Please have a look in our <a href='#tag/Invoice/Types-and-status-of-invoices'>Types and status of invoices</a> to see what the different status codes mean
    - `smallSettlement` boolean — Defines if the client uses the small settlement scheme. If yes, the invoice must not contain any vat
    - `contactPerson` object — The user who acts as a contact person for the invoice
      - `id` string, required — Unique identifier of the user
      - `objectName` string, required — Model name, which is 'SevUser'
    - `taxRate` string — This is not used anymore. Use the taxRate of the individual positions instead.
    - `taxRule` object — **Use this in sevdesk-Update 2.0 (replaces taxType / taxSet).** See [list of available VAT rules](#section/sevdesk-Update-2.0/Tax-Rules).
      - `id` '1' | '2' | '3' | '4' | '5' | '11' | '17' | '18' | '19' | '20' | '21', required
      - `objectName` 'TaxRule', required — Name of the object. Must always be TaxRule
    - `taxText` string — A common tax text would be 'Umsatzsteuer 19%'
    - `dunningLevel` string — Defines how many reminders have already been sent for the invoice. Starts with 1 (Payment reminder) and should be incremented by one every time another reminder is sent.
    - `taxType` 'default' | 'eu' | 'noteu' | 'custom' — **Use this in sevdesk-Update 1.0 (instead of taxRule).** Tax type of the invoice. There are four tax types: 1. default - Umsatzsteuer ausweisen 2. eu - Steuerfreie innergemeinschaftliche Lieferung (Europäische Union) 3. noteu - Steuerschuldnerschaft des Leistungsempfängers (außerhalb EU, z. B. Schweiz) 4. custom - Using custom tax set 5. ss - Not subject to VAT according to §19 1 UStG Tax rates are heavily connected to the tax type used.
    - `paymentMethod` object — Payment method used for the invoice
      - `id` string, required — Unique identifier of the payment method
      - `objectName` string, required — Model name, which is 'PaymentMethod'
    - `costCentre` object — Cost centre for the invoice
      - `id` string, required — Unique identifier of the cost centre
      - `objectName` string, required — Model name, which is 'CostCentre'
    - `sendDate` string, date-time — The date the invoice was sent to the customer
    - `origin` object — Origin of the invoice. Could f.e. be an order
      - `id` string, required — Unique identifier of the object
      - `objectName` string, required — Model name. Could f.e. be 'Order''
    - `invoiceType` 'RE' | 'WKR' | 'SR' | 'MA' | 'TR' | 'AR' | 'ER' — Type of the invoice. For more information on the different types, check <a href='#tag/Invoice/Types-and-status-of-invoices'>this</a> section
    - `accountIntervall` string — The interval in which recurring invoices are due as ISO-8601 duration.<br> Necessary attribute for all recurring invoices.
    - `accountNextInvoice` string — Timestamp when the next invoice will be generated by this recurring invoice.
    - `reminderTotal` string — Total reminder amount
    - `reminderDebit` string — Debit of the reminder
    - `reminderDeadline` string, date-time — Deadline of the reminder as timestamp
    - `reminderCharge` string — The additional reminder charge
    - `taxSet` object — **Use this in sevdesk-Update 1.0 (instead of taxRule).** Tax set of the invoice. Needs to be added if you chose the tax type custom
      - `id` string, required — Unique identifier of the object
      - `objectName` string, required — Model name, which is 'TaxSet'
    - `address` string — Complete address of the recipient including name, street, city, zip and country. * Line breaks can be used and will be displayed on the invoice pdf.
    - `currency` string — Currency used in the invoice. Needs to be currency code according to ISO-4217
    - `sumNet` string — Net sum of the invoice
    - `sumTax` string — Tax sum of the invoice
    - `sumGross` string — Gross sum of the invoice
    - `sumDiscounts` string — Sum of all discounts in the invoice
    - `sumNetForeignCurrency` string — Net sum of the invoice in the foreign currency
    - `sumTaxForeignCurrency` string — Tax sum of the invoice in the foreign currency
    - `sumGrossForeignCurrency` string — Gross sum of the invoice in the foreign currency
    - `sumDiscountsForeignCurrency` string — Discounts sum of the invoice in the foreign currency
    - `sumNetAccounting` string — Net accounting sum of the invoice. Is usually the same as sumNet
    - `sumTaxAccounting` string — Tax accounting sum of the invoice. Is usually the same as sumTax
    - `sumGrossAccounting` string — Gross accounting sum of the invoice. Is usually the same as sumGross
    - `paidAmount` number, float — Amount which has already been paid for this invoice by the customer
    - `customerInternalNote` string — Internal note of the customer. Contains data entered into field 'Referenz/Bestellnummer'
    - `showNet` boolean — If true, the net amount of each position will be shown on the invoice. Otherwise gross amount
    - `enshrined` string, date-time — Enshrined invoices cannot be changed. Can only be set via [Invoice/{invoiceId}/enshrine](#tag/Invoice/operation/invoiceEnshrine). This operation cannot be undone.
    - `sendType` 'VPR' | 'VPDF' | 'VM' | 'VP' — Type which was used to send the invoice. IMPORTANT: Please refer to the invoice section of the * API-Overview to understand how this attribute can be used before using it!
    - `deliveryDateUntil` string — If the delivery date should be a time range, another timestamp can be provided in this attribute * to define a range from timestamp used in deliveryDate attribute to the timestamp used here.
    - `datevConnectOnline` object — Internal attribute
    - `sendPaymentReceivedNotificationDate` string — Internal attribute
  - `invoicePos` ModelInvoicePosResponse[]
    - `id` string — The invoice position id
    - `objectName` string — The invoice position object name
    - `create` string, date-time — Date of invoice position creation
    - `update` string, date-time — Date of last invoice position update
    - `invoice` object — The invoice to which the position belongs.
      - `id` string, required — Unique identifier of the invoice
      - `objectName` string, required — Model name, which is 'Invoice'
    - `part` object — Part from your inventory which is used in the position.
      - `id` string, required — Unique identifier of the part
      - `objectName` string, required — Model name, which is 'Part'
    - `quantity` boolean — Quantity of the article/part
    - `price` string — Price of the article/part. Is either gross or net, depending on the sevdesk account setting.
    - `name` string — Name of the article/part.
    - `unity` object — The unit in which the positions part is measured
      - `id` string, required — Unique identifier of the unit
      - `objectName` string, required — Model name, which is 'Unity'
    - `sevClient` object — Client to which invoice position belongs. Will be filled automatically
      - `id` string, required — Unique identifier of the client
      - `objectName` string, required — Model name, which is 'SevClient'
    - `positionNumber` string — Position number of your position. Can be used to order multiple positions.
    - `text` string — A text describing your position.
    - `discount` string — An optional discount of the position.
    - `taxRate` string — Tax rate of the position.
    - `sumDiscount` string — Discount sum of the position
    - `sumNetAccounting` string — Net accounting sum of the position
    - `sumTaxAccounting` string — Tax accounting sum of the position
    - `sumGrossAccounting` string — Gross accounting sum of the position
    - `priceNet` string — Net price of the part
    - `priceGross` string — Gross price of the part
    - `priceTax` string — Tax on the price of the part
  - `filename` string, binary — Filename of a previously upload file which should be attached.

## Other responses

- `400` — Bad request
- `401` — Authentication required
- `500` — Server Error

---

[API](https://skmtc.net/sevdesk/apis/sevdesk-api.md) · [All operations](https://skmtc.net/sevdesk/apis/sevdesk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sevdesk/sevdesk-api/revisions/a32cec0fecea/schema)
