---
title: "Create/update invoice"
method: POST
path: "/sales/invoice"
tags: ["Sales"]
---

# Create/update invoice

`POST /sales/invoice`

## Request body

- InvoiceDtoIn
  - `override` boolean — Defines whether we wish to override split payments warning, in Machine-machine integrations should be set to `true`
  - `sendToKSEF` boolean — Submit the invoice to KSeF during save.
  - `basicInformation` object
    - `invoiceId` integer — Invoice identificator, used for updating documents
    - `invoiceType` 'SALES' | 'PRO_FORMA' | 'INTERIM' | 'INTERIM_FINAL' | 'CORRECTION', required — The type of invoice we wish to create
    - `invoiceFormat` string, required — Defines the Invoice numbering format that will be used; Altera providesa set of pre-defined formats right after company creation. They can be reviewed in the UI
    - `saleDate` string, required
    - `issueDate` string, required
    - `isReceipt` boolean — Defines whether we are creating an invoice to an already issued receipt
    - `relatedInvoicesIds` object[] — Optional array of invoiceIds that should be related to the document we are creating; Rule of thumb if you wish to work with relatedInvoices (CORRECTION, INTERIM_FINAL) it is best to start from th pre-populated object retrieved via GET /sales/invoice with parameter `related` in use
    - `priceTypeId` 'NET' | 'GROSS', required
    - `statusId` 'DRAFT' | 'ISSUED'
  - `contractor` object
    - `contractorRegion` 'EU' | 'OUTSIDE_OF_EU' | 'POLAND'
    - `country` string — ISO 3166-1 alfa-2 two letter country code
    - `contractorType` 'COMPANY' | 'PRIVATE_PERSON'
    - `contractorName` string
    - `street` string
    - `houseNumber` string
    - `flatNumber` string
    - `city` string
    - `postCode` string
    - `defaultCurrency` string
    - `taxIdentificationNumber` string
    - `email` string — Comma delimited list of contractor e-mails
    - `areaNumber` string
    - `phoneNumber` string
  - `invoicePosition` object[]
    - `productPosition` integer — Zero based position number in invoice
    - `productName` string
    - `positionType` 'PRODUCT' | 'SERVICE'
    - `productCategory` string — Allows grouping of similar products
    - `quantity` number
    - `unit` string
    - `unitNetPrice` number — Defines the net price per item
    - `unitGrossPrice` number — Defines the gross price per item
    - `vat` '23%' | '8%' | '5%' | '0%' | 'np' | 'zw' — Defines the vat rate used for this product
    - `pkwiu` string
    - `discount` string — Defines % discount on given product
    - `invoiceProductId` integer
  - `additionalDetails` string — Describes extra information that we wish to present on the invoice
  - `correctionReason` string — Additional information regarding the reason behing correcting your invoice
  - `payments` object
    - `isPaid` boolean
    - `paymentMethod` 'TRANSFER' | 'CASH' | 'CARD'
    - `dueDate` string
    - `bankAccountNumber` string — Defines the bank account no. we wish to receive funds to
    - `isSplitPayment` boolean

## Response `200`

OK

- object — Regular format of success response in Altera API Retrieved information will always be stored in the 'data' node
  - `data` object
    - `invoiceId` number
  - `result` 'OK'

## Other responses

- `400` — Bad Request

## Changes

> 4 revisions in range; 1 could not be searched.

- **2024-08-26** `64c683372c45` — 1 info
  - endpoint added
- **2024-08-26** `a2d864f3a8db` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/altera-co/apis/openapi/changes/sales/invoice/post.md)

---

[API](https://skmtc.dev/altera-co/apis/openapi.md) · [All operations](https://skmtc.dev/altera-co/apis/openapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/altera-co/openapi/revisions/39a4dd6ca527/schema)
