{
"result": "Error",
"errorMessage": "Enter a date in YYYY-MM-DD format, without a time or time zone, for example 2026-09-14.",
"errorMessagePL": "Podaj datę w formacie RRRR-MM-DD, bez godziny i strefy czasowej, np. 2026-09-14.",
"validationErrors": [
{
"field": "basicInformation.issueDate",
"message": "DATE_REQUIRES_LOCAL_DATE",
"code": "DATE_REQUIRES_LOCAL_DATE"
}
]
}
{
"result": "Error",
"errorMessage": "Enter a date in YYYY-MM-DD format, without a time or time zone, for example 2026-09-14.",
"errorMessagePL": "Podaj datę w formacie RRRR-MM-DD, bez godziny i strefy czasowej, np. 2026-09-14.",
"validationErrors": [
{
"field": "basicInformation.issueDate",
"message": "DATE_REQUIRES_LOCAL_DATE",
"code": "DATE_REQUIRES_LOCAL_DATE"
}
]
}
The current endpoint has no idempotency key or company-unique externalId. The input validator rejects the unknown top-level field externalId. A timeout or lost response does not mean that saving failed: retrying creation can produce another invoice.The response returns the full saved invoice in data, as in the application save flow. Keep data.invoiceId and read the assigned number from data.basicInformation.invoiceNumber. Other saved fields, including lines, totals and payment data, are returned in the same snapshot. There is no data.invoice wrapper in the save response. If reloading the saved document fails, the response uses the in-memory save result, as the application does.When the result of creation is unknown, reconcile existing invoices before issuing another creation request. Sales search includes additionalDetails, so an external reference stored there can help locate a document. It is substring search and does not enforce uniqueness or prevent concurrent duplicates.
For a non-draft invoice, provide payments. Whenever the object is present, include all four required fields: paymentMethod, dueDate, isSplitPayment and isPaid. Send explicit false values when those flags do not apply:
Each correction is a separate invoice with its own identifier and invoice number, linked to the document it corrects.For basicInformation.invoiceType: "CORRECTION", supply line amounts representing the state after the correction, rather than the amount of the reduction. When no explicit before rows are supplied, Altera derives and subtracts the rows from the first invoice in basicInformation.relatedInvoicesIds.quantity must be greater than zero on an ordinary invoice. On a CORRECTION that references a source invoice in basicInformation.relatedInvoicesIds, zero is accepted for the after-correction state, as in the application editor. Negative quantities are rejected. For a full return, set quantity to zero and keep the unit prices and VAT rate. For example, a fully returned line that originally had quantity 1 and a net unit price of 100 has this post-correction state:
For a correction of a correction, reference the previous correction in basicInformation.relatedInvoicesIds and supply the new after-correction state. Altera stores the after-correction rows on each correction and keeps the financial difference in its totals. For example, if invoice A has a line worth 100 and correction B changes it to 80, correction C should reference B and provide 60 to reduce it further. B and C each have a difference of -20.GET /sales/invoice?related={previousCorrectionId}&invoiceType=CORRECTION therefore prepares the rows stored on that correction, such as 80 in this example. Referencing the original invoice A prepares its original rows, such as 100; it does not apply later corrections automatically. Select the document you actually intend to correct and provide the full state after the new correction. This describes the local invoice calculation; submission to KSeF remains subject to KSeF validation.
basicInformation.currency and basicInformation.language are supported on both create and update requests, including in production. These values are saved on the invoice and returned by Get invoice data.
Field
Accepted value
When omitted
basicInformation.currency
Three-letter currency code, for example PLN, EUR or USD. Input is trimmed and converted to uppercase.
Uses contractor.defaultCurrency, then PLN.
basicInformation.language
pl, en, de, es, en_pl or de_pl. The last two select bilingual documents.
Uses pl.
The language controls the invoice document. It does not translate the email body or select an email template. On update, resend these fields to retain their values; omission applies the defaults above.The following request fragment sets an English invoice in EUR:
invoicePosition[].vat supports the distinct values np I and np II in production. They remain distinct when saved and exported to KSeF: np I maps to the P_13_8 summary bucket, and np II maps to P_13_9. The legacy value np maps to np I; use the explicit value for new invoices. Neither is the zw VAT-exemption rate described below.invoicePosition[].gtu is an optional string with a maximum of 10 characters. Use "1" through "13", for example "2". Zero-padded values such as "02" and KSeF values such as "GTU_02" are also supported. KSeF export converts the numeric value to GTU_01 through GTU_13. Omit it, pass null or an empty string when no GTU applies. Set the classification separately on each applicable line.The following request fragment shows the field locations; select the VAT rate and GTU appropriate for the actual transaction:
Send basicInformation.issueDate, basicInformation.saleDate, payments.dueDate and optional payments.paymentDate as strings in YYYY-MM-DD format, for example "2026-09-14". These fields represent calendar dates without a time or time zone. Do not convert them to UTC or serialize them with toISOString().For example, if the invoice date is September 15, send "2026-09-15", rather than "2026-09-14T22:00:00Z". Use the same date regardless of the client’s time zone. Timestamps representing an event time have different semantics and can include a time zone.Legacy date-time inputs may still be accepted for compatibility. Non-midnight values can be converted to the calendar date in Europe/Warsaw; the save response does not include a warning about that conversion. With strict date validation enabled, non-midnight date-time values are rejected with HTTP 400 and validationErrors[].code = "DATE_REQUIRES_LOCAL_DATE". Legacy midnight values are still accepted without changing their written date. Always send YYYY-MM-DD for new integrations.Validation errors include an English description in errorMessage, a Polish description in errorMessagePL, and the affected field in validationErrors[].field.
If at least one invoice item uses the "vat": "zw" rate, provide vatExemptionReason at the top level of the request, alongside invoicePosition, additionalDetails, and payments.Altera resolves the legal basis from vatExemptionReason on the invoice, then from the company’s VAT-exemption setting. An ISSUED or SENT sales invoice containing a zw line requires a nonempty basis before it can be saved. Missing basis returns HTTP 400 with validationErrors[].code = "KSEF_VAT_EXEMPTION_LEGAL_BASIS_REQUIRED". override does not bypass this check. A DRAFT can remain incomplete. Providing the invoice basis explicitly makes it independent of the company default.KSeF submission checks generated XML and previously stored XML. Exempt invoices require P_19 = 1 and exactly one nonempty P_19A, P_19B or P_19C, without the no-exemption marker P_19N. Newly generated Altera XML uses P_19A for the selected basis. A successful save alone does not confirm acceptance by KSeF.The field accepts exactly one of these three values:
Zwolnienie podmiotowe z art. 113 ust. 1 i 9
Zwolnienie przedmiotowe z art. 43 ust. 1
Zwolnienie przedmiotowe z art. 82 ust. 3
vatExemptionReasonDetailed is optional. It accepts up to 500 characters of additional wording displayed on the invoice below the selected legal basis. It does not replace vatExemptionReason. Altera submits vatExemptionReason to KSeF as P_19A.The following request fragment shows an invoice item using the zw rate:
When updating an existing invoice, use the same fields and provide the document identifier in basicInformation.invoiceId. If the invoice has no item using the zw rate, omit both fields.
Keep the buyer in contractor. Add a separate recipient to the top-level additionalParties array, alongside contractor, basicInformation and payments. These are structured invoice parties (Podmiot3 in KSeF), rather than text in additionalDetails or contractor.houseNumber.The following request fragment adds a recipient. Replace the illustrative name, address and tax identity with the actual party data:
Use RECIPIENT for an ordinary separate recipient. Do not automatically select JST_RECIPIENT just because the recipient is a school: choose the role that matches the actual local government arrangement, because it changes the KSeF mapping.internalId is optional. When used, send a string containing exactly five digits, including any leading zeros. It is the suffix, not the complete KSeF identifier. For Podmiot3 export it requires a Polish 10-digit NIP and Polish country; the example produces IDWew equal to 5260250274-00123. Omit internalId when the party does not use an internal identifier.Address fields belong to this additional party. houseNumber contains only the building number (maximum 20 characters), and postCode contains the postal code. Do not combine buyer and recipient addresses in one field.For an update, provide basicInformation.invoiceId together with the intended invoice data and additional parties. This does not retroactively correct previously issued documents; invoices already submitted to or accepted by KSeF have content-edit restrictions and may require a correction invoice. The legacy alias additionalContractors is also accepted; use additionalParties for new integrations and avoid sending both.
Use the singular top-level project object in POST /sales/invoice, alongside basicInformation, contractor and payments. One project is assigned to the invoice. The following fragment must be combined with the remaining invoice data:
Use the actual project object from the same company. tagId identifies the existing project; name, enabled and color are also required by invoice validation. Sending only { "tagId": 161 } is insufficient. The name must be nonempty, enabled is a boolean, and color is the project’s numeric ARGB value (4278190080–4294967295).Fetch existing projects using List projects (GET /company/projects, or GET /company/projects?onlyActive=1 for active projects), find the desired project by name in data, and use its complete object as project.Saving an invoice does not create a project from its name. If necessary, first create the project using Add/modify a project (POST /company/projects), then use the returned project data including its tagId when saving the invoice.For an existing invoice, include basicInformation.invoiceId and the intended invoice data:
To retain the assignment, send the current project again.
To change it, send the new project object.
To remove it, omit project from the update payload. This endpoint is not a partial PATCH that preserves every omitted field. project: null is not accepted.
The sales save flow copies the header project to all invoice line items, replacing line-level project values. Removing the header project also clears line-level assignments. Set the project at the invoice level rather than trying to assign different projects per sales line.Do not send projects: [], an array of projects, or a project name as a plain string. The current request validator expects project to be an object and rejects the unknown top-level field projects.
Set the top-level boolean sendToKSEF to true to request submission during the save flow, after the invoice has been persisted. To issue a new invoice and request immediate submission, use this fragment together with the remaining required buyer, line-item and payment data:
The default is false. Omitting the flag or sending false does not request immediate submission, but does not disable normal automatic KSeF processing. Eligible invoices can still enter the pending workflow.
The flag does not issue a draft. The invoice must be ISSUED or SENT; a draft is not submitted.
KSeF integration and outgoing submission must be enabled for the company. The flag does not override company settings, private-person invoice policy or KSeF validation. If the integration or outgoing submission is disabled, the save flow can skip submission without returning a KSeF warning.
sendToKSEF: true is rejected for PRO_FORMA, ORDER and DEBIT_NOTE.
The compatibility spelling sendToKsef is also accepted. Prefer sendToKSEF; if both are sent, their values must agree.
A normal save returns HTTP 200 with the saved invoice identifier:
{ "result": "OK", "data": { "invoiceId": 12413 }}
When immediate submission returns an unsuccessful result after saving, the endpoint still returns HTTP 200 and result: "OK", with optional KSeF details. For example:
{ "result": "OK", "data": { "invoiceId": 12413, "ksefWarning": "Wysyłka faktur dla osób prywatnych do KSeF jest wyłączona w ustawieniach firmy.", "ksefErrorMessage": "Wysyłka faktur dla osób prywatnych do KSeF jest wyłączona w ustawieniach firmy.", "ksefReason": "KSEF_PRIVATE_PERSON_SEND_DISABLED" }}
Inspect ksefWarning, ksefErrorMessage and ksefReason even on HTTP 200. Reason codes are an open set; another possible value is KSEF_SUBMISSION_FAILED. Absence of these fields is not proof of KSeF acceptance. Retrieve the saved invoice through Get invoice data and inspect ksef.ksefStatus, ksef.ksefId and any ksef.ksefErrorMessage.Keep the returned invoiceId. Do not create the same invoice again because KSeF submission failed. Resolve the KSeF issue and use the existing invoice’s submission/retry workflow. For request validation errors, correct the input before retrying; do not repeatedly resend the same invalid payload. This warning response describes unsuccessful submission results after save; other validation or processing failures can still return an error response.
Request immediate KSeF submission after saving an eligible ISSUED or SENT invoice. Defaults to false; false does not disable normal automatic KSeF processing. Requires KSeF and outgoing submission enabled for the company and an eligible invoice. Does not issue a DRAFT or guarantee KSeF acceptance. Inspect data.ksefWarning, data.ksefErrorMessage and data.ksefReason even on HTTP 200, then check the saved invoice KSeF status. Not allowed for PRO_FORMA, ORDER or DEBIT_NOTE. See the endpoint guide for examples and retry handling.
Legal basis for a zw line. Required before issuing a sales invoice unless a nonempty company default supplies the basis. Drafts may omit it. Missing basis returns validation code KSEF_VAT_EXEMPTION_LEGAL_BASIS_REQUIRED, which override cannot bypass. New XML uses P_19A. Submission also checks stored XML for P_19=1, exactly one nonempty P_19A/B/C, and no P_19N.
Required when statusId is not DRAFT. Whenever this object is supplied, include paymentMethod, dueDate, isSplitPayment and isPaid, including explicit false values for the booleans.
Single project assigned to the invoice. Pass an existing project from the same company, including tagId, name, enabled and color. Assignment is persisted by tagId; saving an invoice does not create a project. On update, resend project to retain the assignment; omitting it removes the assignment. The header project is propagated to sales line items. Use project, not projects.
Invoice saved. HTTP 200 confirms the save, not acceptance by KSeF. A failed immediate submission can be reported in optional data.ksefWarning, data.ksefErrorMessage and data.ksefReason fields.
Regular format of success response in Altera API
Retrieved information will always be stored in the 'data' node
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Altera Docs","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"favicon":"https://mintcdn.com/altera/hCq3eyhMdRMi2Lul/favicon.png?fit=max\u0026auto=format\u0026n=hCq3eyhMdRMi2Lul\u0026q=85\u0026s=15c5298ca49cceecc253c3f6183ba5fc","logo":{"light":"https://mintcdn.com/altera/m_Elx8565ISejHL9/logo/light.png?fit=max\u0026auto=format\u0026n=m_Elx8565ISejHL9\u0026q=85\u0026s=ff811307dfde2a632e6f62d2d1ca8613","dark":"https://mintcdn.com/altera/m_Elx8565ISejHL9/logo/dark.png?fit=max\u0026auto=format\u0026n=m_Elx8565ISejHL9\u0026q=85\u0026s=2abd8d7b0f65822af88cdb0b387d0860"},"navbar":{"links":[{"label":"Support","href":"mailto:wsparcie@altera.co"}],"primary":{"type":"button","label":"Dashboard","href":"/"}},"footer":{"socials":{"facebook":"https://www.facebook.com/Altera.co","github":"https://github.com/Altera-co","linkedin":"https://www.linkedin.com/company/altera-nowy-wymiar-ksiegowosci/"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"altera","hasAudioNarration":false,"actualSubdomain":"altera","customDomains":["docs.altera.co"],"gitSource":{"type":"github","owner":"altera-co","repo":"altera-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6acd1b9525da98d34638e413","collectionId":"b4f615ab-cac9-467b-97df-5d86662ccc17","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6acd1b9525da98d34638e413"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{},"buildId":"6acd1b9525da98d34638e413","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Centrum pomocy","count":82},{"language":"default","tag":"OpenAPI","count":17},{"language":"default","tag":"Fakturowanie i należności","count":10},{"language":"default","tag":"Koszty i płatności","count":8},{"language":"default","tag":"Sales","count":8},{"language":"default","tag":"Dokumenty i współpraca","count":7},{"language":"default","tag":"Start i ustawienia","count":7},{"language":"default","tag":"KSEF","count":6},{"language":"default","tag":"KSeF","count":6},{"language":"default","tag":"Finanse","count":5}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"openapi/sales/createupdate-invoice","slug":"/openapi/sales/createupdate-invoice","pageMetadata":{"openapi":"post /sales/invoice","description":"Create or update a sales invoice in Altera via the OpenAPI. Set basicInformation.statusId to ISSUED to issue, or save the document as a draft.","title":"Create/update invoice","href":"/openapi/sales/createupdate-invoice"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create or update a sales invoice in Altera via the OpenAPI. Set basicInformation.statusId to ISSUED to issue, or save the document as a draft.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`creation-retries-and-invoice-number`,children:`Creation retries and invoice number`}),`\n`,_jsxs(_components.p,{children:[`The current endpoint has no idempotency key or company-unique `,_jsx(_components.code,{children:`externalId`}),`. The input validator rejects the unknown top-level field `,_jsx(_components.code,{children:`externalId`}),`. A timeout or lost response does not mean that saving failed: retrying creation can produce another invoice.`]}),`\n`,_jsxs(_components.p,{children:[`The response returns the full saved invoice in `,_jsx(_components.code,{children:`data`}),`, as in the application save flow. Keep `,_jsx(_components.code,{children:`data.invoiceId`}),` and read the assigned number from `,_jsx(_components.code,{children:`data.basicInformation.invoiceNumber`}),`. Other saved fields, including lines, totals and payment data, are returned in the same snapshot. There is no `,_jsx(_components.code,{children:`data.invoice`}),` wrapper in the save response. If reloading the saved document fails, the response uses the in-memory save result, as the application does.`]}),`\n`,_jsxs(_components.p,{children:[`When the result of creation is unknown, reconcile existing invoices before issuing another creation request. `,_jsx(_components.a,{href:`/openapi/sales/list-available-invoices`,children:`Sales search`}),` includes `,_jsx(_components.code,{children:`additionalDetails`}),`, so an external reference stored there can help locate a document. It is substring search and does not enforce uniqueness or prevent concurrent duplicates.`]}),`\n`,_jsx(Heading,{level:`2`,id:`payment-fields`,children:`Payment fields`}),`\n`,_jsxs(_components.p,{children:[`For a non-draft invoice, provide `,_jsx(_components.code,{children:`payments`}),`. Whenever the object is present, include all four required fields: `,_jsx(_components.code,{children:`paymentMethod`}),`, `,_jsx(_components.code,{children:`dueDate`}),`, `,_jsx(_components.code,{children:`isSplitPayment`}),` and `,_jsx(_components.code,{children:`isPaid`}),`. Send explicit `,_jsx(_components.code,{children:`false`}),` values when those flags do not apply:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"payments\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"paymentMethod\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"TRANSFER\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"dueDate\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-19\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"isSplitPayment\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"isPaid\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`corrections-and-full-returns`,children:`Corrections and full returns`}),`\n`,_jsx(_components.p,{children:`Each correction is a separate invoice with its own identifier and invoice number, linked to the document it corrects.`}),`\n`,_jsxs(_components.p,{children:[`For `,_jsx(_components.code,{children:`basicInformation.invoiceType: \"CORRECTION\"`}),`, supply line amounts representing the state after the correction, rather than the amount of the reduction. When no explicit before rows are supplied, Altera derives and subtracts the rows from the first invoice in `,_jsx(_components.code,{children:`basicInformation.relatedInvoicesIds`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`quantity`}),` must be greater than zero on an ordinary invoice. On a `,_jsx(_components.code,{children:`CORRECTION`}),` that references a source invoice in `,_jsx(_components.code,{children:`basicInformation.relatedInvoicesIds`}),`, zero is accepted for the after-correction state, as in the application editor. Negative quantities are rejected. For a full return, set `,_jsx(_components.code,{children:`quantity`}),` to zero and keep the unit prices and VAT rate. For example, a fully returned line that originally had quantity 1 and a net unit price of 100 has this post-correction state:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"invoicePosition\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"positionType\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SERVICE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"productName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Returned service\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"quantity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"unitNetPrice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"unitGrossPrice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`123`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"vat\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"23%\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`For a correction of a correction, reference the previous correction in `,_jsx(_components.code,{children:`basicInformation.relatedInvoicesIds`}),` and supply the new after-correction state. Altera stores the after-correction rows on each correction and keeps the financial difference in its totals. For example, if invoice A has a line worth 100 and correction B changes it to 80, correction C should reference B and provide 60 to reduce it further. B and C each have a difference of -20.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`GET /sales/invoice?related={previousCorrectionId}\u0026invoiceType=CORRECTION`}),` therefore prepares the rows stored on that correction, such as 80 in this example. Referencing the original invoice A prepares its original rows, such as 100; it does not apply later corrections automatically. Select the document you actually intend to correct and provide the full state after the new correction. This describes the local invoice calculation; submission to KSeF remains subject to KSeF validation.`]}),`\n`,_jsx(Heading,{level:`2`,id:`currency-and-document-language`,children:`Currency and document language`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`basicInformation.currency`}),` and `,_jsx(_components.code,{children:`basicInformation.language`}),` are supported on both create and update requests, including in production. These values are saved on the invoice and returned by `,_jsx(_components.a,{href:`/openapi/sales/get-invoice-data`,children:`Get invoice data`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Accepted value`}),_jsx(_components.th,{children:`When omitted`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`basicInformation.currency`})}),_jsxs(_components.td,{children:[`Three-letter currency code, for example `,_jsx(_components.code,{children:`PLN`}),`, `,_jsx(_components.code,{children:`EUR`}),` or `,_jsx(_components.code,{children:`USD`}),`. Input is trimmed and converted to uppercase.`]}),_jsxs(_components.td,{children:[`Uses `,_jsx(_components.code,{children:`contractor.defaultCurrency`}),`, then `,_jsx(_components.code,{children:`PLN`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`basicInformation.language`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`pl`}),`, `,_jsx(_components.code,{children:`en`}),`, `,_jsx(_components.code,{children:`de`}),`, `,_jsx(_components.code,{children:`es`}),`, `,_jsx(_components.code,{children:`en_pl`}),` or `,_jsx(_components.code,{children:`de_pl`}),`. The last two select bilingual documents.`]}),_jsxs(_components.td,{children:[`Uses `,_jsx(_components.code,{children:`pl`}),`.`]})]})]})]}),`\n`,_jsx(_components.p,{children:`The language controls the invoice document. It does not translate the email body or select an email template. On update, resend these fields to retain their values; omission applies the defaults above.`}),`\n`,_jsx(_components.p,{children:`The following request fragment sets an English invoice in EUR:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"basicInformation\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"currency\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"EUR\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"language\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"en\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`non-subject-vat-rates-and-gtu`,children:`Non-subject VAT rates and GTU`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`invoicePosition[].vat`}),` supports the distinct values `,_jsx(_components.code,{children:`np I`}),` and `,_jsx(_components.code,{children:`np II`}),` in production. They remain distinct when saved and exported to KSeF: `,_jsx(_components.code,{children:`np I`}),` maps to the `,_jsx(_components.code,{children:`P_13_8`}),` summary bucket, and `,_jsx(_components.code,{children:`np II`}),` maps to `,_jsx(_components.code,{children:`P_13_9`}),`. The legacy value `,_jsx(_components.code,{children:`np`}),` maps to `,_jsx(_components.code,{children:`np I`}),`; use the explicit value for new invoices. Neither is the `,_jsx(_components.code,{children:`zw`}),` VAT-exemption rate described below.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`invoicePosition[].gtu`}),` is an optional string with a maximum of 10 characters. Use `,_jsx(_components.code,{children:`\"1\"`}),` through `,_jsx(_components.code,{children:`\"13\"`}),`, for example `,_jsx(_components.code,{children:`\"2\"`}),`. Zero-padded values such as `,_jsx(_components.code,{children:`\"02\"`}),` and KSeF values such as `,_jsx(_components.code,{children:`\"GTU_02\"`}),` are also supported. KSeF export converts the numeric value to `,_jsx(_components.code,{children:`GTU_01`}),` through `,_jsx(_components.code,{children:`GTU_13`}),`. Omit it, pass `,_jsx(_components.code,{children:`null`}),` or an empty string when no GTU applies. Set the classification separately on each applicable line.`]}),`\n`,_jsx(_components.p,{children:`The following request fragment shows the field locations; select the VAT rate and GTU appropriate for the actual transaction:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"invoicePosition\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"positionType\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SERVICE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"productName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Example service\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"quantity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"unitNetPrice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"vat\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"np II\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"gtu\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"12\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`calendar-dates`,children:`Calendar dates`}),`\n`,_jsxs(_components.p,{children:[`Send `,_jsx(_components.code,{children:`basicInformation.issueDate`}),`, `,_jsx(_components.code,{children:`basicInformation.saleDate`}),`, `,_jsx(_components.code,{children:`payments.dueDate`}),` and optional `,_jsx(_components.code,{children:`payments.paymentDate`}),` as strings in `,_jsx(_components.code,{children:`YYYY-MM-DD`}),` format, for example `,_jsx(_components.code,{children:`\"2026-09-14\"`}),`. These fields represent calendar dates without a time or time zone. Do not convert them to UTC or serialize them with `,_jsx(_components.code,{children:`toISOString()`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`For example, if the invoice date is September 15, send `,_jsx(_components.code,{children:`\"2026-09-15\"`}),`, rather than `,_jsx(_components.code,{children:`\"2026-09-14T22:00:00Z\"`}),`. Use the same date regardless of the client’s time zone. Timestamps representing an event time have different semantics and can include a time zone.`]}),`\n`,_jsxs(_components.p,{children:[`Legacy date-time inputs may still be accepted for compatibility. Non-midnight values can be converted to the calendar date in `,_jsx(_components.code,{children:`Europe/Warsaw`}),`; the save response does not include a warning about that conversion. With strict date validation enabled, non-midnight date-time values are rejected with HTTP 400 and `,_jsx(_components.code,{children:`validationErrors[].code = \"DATE_REQUIRES_LOCAL_DATE\"`}),`. Legacy midnight values are still accepted without changing their written date. Always send `,_jsx(_components.code,{children:`YYYY-MM-DD`}),` for new integrations.`]}),`\n`,_jsxs(_components.p,{children:[`Validation errors include an English description in `,_jsx(_components.code,{children:`errorMessage`}),`, a Polish description in `,_jsx(_components.code,{children:`errorMessagePL`}),`, and the affected field in `,_jsx(_components.code,{children:`validationErrors[].field`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`vat-exempt-invoices`,children:`VAT-exempt invoices`}),`\n`,_jsxs(_components.p,{children:[`If at least one invoice item uses the `,_jsx(_components.code,{children:`\"vat\": \"zw\"`}),` rate, provide `,_jsx(_components.code,{children:`vatExemptionReason`}),` at the top level of the request, alongside `,_jsx(_components.code,{children:`invoicePosition`}),`, `,_jsx(_components.code,{children:`additionalDetails`}),`, and `,_jsx(_components.code,{children:`payments`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Altera resolves the legal basis from `,_jsx(_components.code,{children:`vatExemptionReason`}),` on the invoice, then from the company’s VAT-exemption setting. An `,_jsx(_components.code,{children:`ISSUED`}),` or `,_jsx(_components.code,{children:`SENT`}),` sales invoice containing a `,_jsx(_components.code,{children:`zw`}),` line requires a nonempty basis before it can be saved. Missing basis returns HTTP 400 with `,_jsx(_components.code,{children:`validationErrors[].code = \"KSEF_VAT_EXEMPTION_LEGAL_BASIS_REQUIRED\"`}),`. `,_jsx(_components.code,{children:`override`}),` does not bypass this check. A `,_jsx(_components.code,{children:`DRAFT`}),` can remain incomplete. Providing the invoice basis explicitly makes it independent of the company default.`]}),`\n`,_jsxs(_components.p,{children:[`KSeF submission checks generated XML and previously stored XML. Exempt invoices require `,_jsx(_components.code,{children:`P_19 = 1`}),` and exactly one nonempty `,_jsx(_components.code,{children:`P_19A`}),`, `,_jsx(_components.code,{children:`P_19B`}),` or `,_jsx(_components.code,{children:`P_19C`}),`, without the no-exemption marker `,_jsx(_components.code,{children:`P_19N`}),`. Newly generated Altera XML uses `,_jsx(_components.code,{children:`P_19A`}),` for the selected basis. A successful save alone does not confirm acceptance by KSeF.`]}),`\n`,_jsx(_components.p,{children:`The field accepts exactly one of these three values:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`Zwolnienie podmiotowe z art. 113 ust. 1 i 9`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`Zwolnienie przedmiotowe z art. 43 ust. 1`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`Zwolnienie przedmiotowe z art. 82 ust. 3`})}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`vatExemptionReasonDetailed`}),` is optional. It accepts up to 500 characters of additional wording displayed on the invoice below the selected legal basis. It does not replace `,_jsx(_components.code,{children:`vatExemptionReason`}),`. Altera submits `,_jsx(_components.code,{children:`vatExemptionReason`}),` to KSeF as P_19A.`]}),`\n`,_jsxs(_components.p,{children:[`The following request fragment shows an invoice item using the `,_jsx(_components.code,{children:`zw`}),` rate:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"invoicePosition\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"productName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"VAT-exempt service\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"positionType\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SERVICE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"quantity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"unit\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"szt.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"unitNetPrice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"unitGrossPrice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"vat\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"zw\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"discount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"vatExemptionReason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Zwolnienie przedmiotowe z art. 43 ust. 1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"vatExemptionReasonDetailed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Optional detailed wording of the legal basis\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`When updating an existing invoice, use the same fields and provide the document identifier in `,_jsx(_components.code,{children:`basicInformation.invoiceId`}),`. If the invoice has no item using the `,_jsx(_components.code,{children:`zw`}),` rate, omit both fields.`]}),`\n`,_jsx(Heading,{level:`2`,id:`separate-recipients-and-other-additional-parties`,children:`Separate recipients and other additional parties`}),`\n`,_jsxs(_components.p,{children:[`Keep the buyer in `,_jsx(_components.code,{children:`contractor`}),`. Add a separate recipient to the top-level `,_jsx(_components.code,{children:`additionalParties`}),` array, alongside `,_jsx(_components.code,{children:`contractor`}),`, `,_jsx(_components.code,{children:`basicInformation`}),` and `,_jsx(_components.code,{children:`payments`}),`. These are structured invoice parties (Podmiot3 in KSeF), rather than text in `,_jsx(_components.code,{children:`additionalDetails`}),` or `,_jsx(_components.code,{children:`contractor.houseNumber`}),`.`]}),`\n`,_jsx(_components.p,{children:`The following request fragment adds a recipient. Replace the illustrative name, address and tax identity with the actual party data:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"additionalParties\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"semanticRole\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"RECIPIENT\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"contractorName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Example recipient\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"contractorType\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"COMPANY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"contractorRegion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLAND\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"country\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"PL\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"taxIdentificationNumber\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"5260250274\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"internalId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"00123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"street\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Przykładowa\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"houseNumber\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"28\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"city\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Warszawa\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"postCode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"00-001\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`semanticRole`}),` accepts the following values:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`FACTOR`})}),_jsx(_components.td,{children:`Factor`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`RECIPIENT`})}),_jsx(_components.td,{children:`Recipient`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`BRANCH`})}),_jsx(_components.td,{children:`Branch / recipient`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ORIGINAL_ENTITY`})}),_jsx(_components.td,{children:`Original entity`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ADDITIONAL_BUYER`})}),_jsx(_components.td,{children:`Additional buyer`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ISSUER`})}),_jsx(_components.td,{children:`Invoice issuer`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PAYEE`})}),_jsx(_components.td,{children:`Party making the payment (KSeF role 6)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JST_ISSUER`})}),_jsx(_components.td,{children:`Local government unit issuer`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JST_RECIPIENT`})}),_jsx(_components.td,{children:`Local government unit recipient`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`VAT_GROUP_ISSUER`})}),_jsx(_components.td,{children:`VAT group member issuing the invoice`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`VAT_GROUP_RECIPIENT`})}),_jsx(_components.td,{children:`VAT group member receiving the invoice`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`EMPLOYEE`})}),_jsx(_components.td,{children:`Employee`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`OTHER`})}),_jsxs(_components.td,{children:[`Other role; provide its description in `,_jsx(_components.code,{children:`roleOther`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`RECIPIENT`}),` for an ordinary separate recipient. Do not automatically select `,_jsx(_components.code,{children:`JST_RECIPIENT`}),` just because the recipient is a school: choose the role that matches the actual local government arrangement, because it changes the KSeF mapping.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`internalId`}),` is optional. When used, send a string containing exactly five digits, including any leading zeros. It is the suffix, not the complete KSeF identifier. For Podmiot3 export it requires a Polish 10-digit NIP and Polish country; the example produces `,_jsx(_components.code,{children:`IDWew`}),` equal to `,_jsx(_components.code,{children:`5260250274-00123`}),`. Omit `,_jsx(_components.code,{children:`internalId`}),` when the party does not use an internal identifier.`]}),`\n`,_jsxs(_components.p,{children:[`Address fields belong to this additional party. `,_jsx(_components.code,{children:`houseNumber`}),` contains only the building number (maximum 20 characters), and `,_jsx(_components.code,{children:`postCode`}),` contains the postal code. Do not combine buyer and recipient addresses in one field.`]}),`\n`,_jsxs(_components.p,{children:[`For an update, provide `,_jsx(_components.code,{children:`basicInformation.invoiceId`}),` together with the intended invoice data and additional parties. This does not retroactively correct previously issued documents; invoices already submitted to or accepted by KSeF have content-edit restrictions and may require a correction invoice. The legacy alias `,_jsx(_components.code,{children:`additionalContractors`}),` is also accepted; use `,_jsx(_components.code,{children:`additionalParties`}),` for new integrations and avoid sending both.`]}),`\n`,_jsx(Heading,{level:`2`,id:`assigning-a-project-to-an-invoice`,children:`Assigning a project to an invoice`}),`\n`,_jsxs(_components.p,{children:[`Use the singular top-level `,_jsx(_components.code,{children:`project`}),` object in `,_jsx(_components.code,{children:`POST /sales/invoice`}),`, alongside `,_jsx(_components.code,{children:`basicInformation`}),`, `,_jsx(_components.code,{children:`contractor`}),` and `,_jsx(_components.code,{children:`payments`}),`. One project is assigned to the invoice. The following fragment must be combined with the remaining invoice data:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"project\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"tagId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`161`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Website implementation\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"enabled\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"color\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4286963618`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Use the actual project object from the same company. `,_jsx(_components.code,{children:`tagId`}),` identifies the existing project; `,_jsx(_components.code,{children:`name`}),`, `,_jsx(_components.code,{children:`enabled`}),` and `,_jsx(_components.code,{children:`color`}),` are also required by invoice validation. Sending only `,_jsx(_components.code,{children:`{ \"tagId\": 161 }`}),` is insufficient. The name must be nonempty, `,_jsx(_components.code,{children:`enabled`}),` is a boolean, and `,_jsx(_components.code,{children:`color`}),` is the project’s numeric ARGB value (4278190080–4294967295).`]}),`\n`,_jsxs(_components.p,{children:[`Fetch existing projects using `,_jsx(_components.a,{href:`/openapi/configuration/list-projects`,children:`List projects`}),` (`,_jsx(_components.code,{children:`GET /company/projects`}),`, or `,_jsx(_components.code,{children:`GET /company/projects?onlyActive=1`}),` for active projects), find the desired project by name in `,_jsx(_components.code,{children:`data`}),`, and use its complete object as `,_jsx(_components.code,{children:`project`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Saving an invoice does not create a project from its name. If necessary, first create the project using `,_jsx(_components.a,{href:`/openapi/configuration/addmodify-a-project`,children:`Add/modify a project`}),` (`,_jsx(_components.code,{children:`POST /company/projects`}),`), then use the returned project data including its `,_jsx(_components.code,{children:`tagId`}),` when saving the invoice.`]}),`\n`,_jsxs(_components.p,{children:[`For an existing invoice, include `,_jsx(_components.code,{children:`basicInformation.invoiceId`}),` and the intended invoice data:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`To retain the assignment, send the current `,_jsx(_components.code,{children:`project`}),` again.`]}),`\n`,_jsx(_components.li,{children:`To change it, send the new project object.`}),`\n`,_jsxs(_components.li,{children:[`To remove it, omit `,_jsx(_components.code,{children:`project`}),` from the update payload. This endpoint is not a partial PATCH that preserves every omitted field. `,_jsx(_components.code,{children:`project: null`}),` is not accepted.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`The sales save flow copies the header project to all invoice line items, replacing line-level project values. Removing the header project also clears line-level assignments. Set the project at the invoice level rather than trying to assign different projects per sales line.`}),`\n`,_jsxs(_components.p,{children:[`Do not send `,_jsx(_components.code,{children:`projects: []`}),`, an array of projects, or a project name as a plain string. The current request validator expects `,_jsx(_components.code,{children:`project`}),` to be an object and rejects the unknown top-level field `,_jsx(_components.code,{children:`projects`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`immediate-ksef-submission`,children:`Immediate KSeF submission`}),`\n`,_jsxs(_components.p,{children:[`Set the top-level boolean `,_jsx(_components.code,{children:`sendToKSEF`}),` to `,_jsx(_components.code,{children:`true`}),` to request submission during the save flow, after the invoice has been persisted. To issue a new invoice and request immediate submission, use this fragment together with the remaining required buyer, line-item and payment data:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sendToKSEF\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"basicInformation\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"invoiceType\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SALES\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"invoiceFormat\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"%N/%M/%Y\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"statusId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ISSUED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"issueDate\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-09-14\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"saleDate\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-09-14\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"priceTypeId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"NET\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The default is `,_jsx(_components.code,{children:`false`}),`. Omitting the flag or sending `,_jsx(_components.code,{children:`false`}),` does not request immediate submission, but does not disable normal automatic KSeF processing. Eligible invoices can still enter the pending workflow.`]}),`\n`,_jsxs(_components.li,{children:[`The flag does not issue a draft. The invoice must be `,_jsx(_components.code,{children:`ISSUED`}),` or `,_jsx(_components.code,{children:`SENT`}),`; a draft is not submitted.`]}),`\n`,_jsx(_components.li,{children:`KSeF integration and outgoing submission must be enabled for the company. The flag does not override company settings, private-person invoice policy or KSeF validation. If the integration or outgoing submission is disabled, the save flow can skip submission without returning a KSeF warning.`}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`sendToKSEF: true`}),` is rejected for `,_jsx(_components.code,{children:`PRO_FORMA`}),`, `,_jsx(_components.code,{children:`ORDER`}),` and `,_jsx(_components.code,{children:`DEBIT_NOTE`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`The compatibility spelling `,_jsx(_components.code,{children:`sendToKsef`}),` is also accepted. Prefer `,_jsx(_components.code,{children:`sendToKSEF`}),`; if both are sent, their values must agree.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`save-success-is-not-ksef-acceptance`,children:`Save success is not KSeF acceptance`}),`\n`,_jsxs(_components.p,{children:[`A normal save returns HTTP `,_jsx(_components.code,{children:`200`}),` with the saved invoice identifier:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"result\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"OK\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"invoiceId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12413`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`When immediate submission returns an unsuccessful result after saving, the endpoint still returns HTTP `,_jsx(_components.code,{children:`200`}),` and `,_jsx(_components.code,{children:`result: \"OK\"`}),`, with optional KSeF details. For example:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"result\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"OK\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"invoiceId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12413`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ksefWarning\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Wysyłka faktur dla osób prywatnych do KSeF jest wyłączona w ustawieniach firmy.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ksefErrorMessage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Wysyłka faktur dla osób prywatnych do KSeF jest wyłączona w ustawieniach firmy.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ksefReason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"KSEF_PRIVATE_PERSON_SEND_DISABLED\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Inspect `,_jsx(_components.code,{children:`ksefWarning`}),`, `,_jsx(_components.code,{children:`ksefErrorMessage`}),` and `,_jsx(_components.code,{children:`ksefReason`}),` even on HTTP `,_jsx(_components.code,{children:`200`}),`. Reason codes are an open set; another possible value is `,_jsx(_components.code,{children:`KSEF_SUBMISSION_FAILED`}),`. Absence of these fields is not proof of KSeF acceptance. Retrieve the saved invoice through `,_jsx(_components.a,{href:`/openapi/sales/get-invoice-data`,children:`Get invoice data`}),` and inspect `,_jsx(_components.code,{children:`ksef.ksefStatus`}),`, `,_jsx(_components.code,{children:`ksef.ksefId`}),` and any `,_jsx(_components.code,{children:`ksef.ksefErrorMessage`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Keep the returned `,_jsx(_components.code,{children:`invoiceId`}),`. Do not create the same invoice again because KSeF submission failed. Resolve the KSeF issue and use the existing invoice’s submission/retry workflow. For request validation errors, correct the input before retrying; do not repeatedly resend the same invalid payload. This warning response describes unsuccessful submission results after save; other validation or processing failures can still return an error response.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"post /sales/invoice","description":"Create or update a sales invoice in Altera via the OpenAPI. Set basicInformation.statusId to ISSUED to issue, or save the document as a draft.","title":"Create/update invoice","href":"/openapi/sales/createupdate-invoice"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Creation retries and invoice number","slug":"creation-retries-and-invoice-number","depth":2,"children":[]},{"title":"Payment fields","slug":"payment-fields","depth":2,"children":[]},{"title":"Corrections and full returns","slug":"corrections-and-full-returns","depth":2,"children":[]},{"title":"Currency and document language","slug":"currency-and-document-language","depth":2,"children":[]},{"title":"Non-subject VAT rates and GTU","slug":"non-subject-vat-rates-and-gtu","depth":2,"children":[]},{"title":"Calendar dates","slug":"calendar-dates","depth":2,"children":[]},{"title":"VAT-exempt invoices","slug":"vat-exempt-invoices","depth":2,"children":[]},{"title":"Separate recipients and other additional parties","slug":"separate-recipients-and-other-additional-parties","depth":2,"children":[]},{"title":"Assigning a project to an invoice","slug":"assigning-a-project-to-an-invoice","depth":2,"children":[]},{"title":"Immediate KSeF submission","slug":"immediate-ksef-submission","depth":2,"children":[{"title":"Save success is not KSeF acceptance","slug":"save-success-is-not-ksef-acceptance","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Create/update invoice","operationId":"post-sales","responses":{"200":"68643623-08e9-44cc-96c4-74e99d603c57","400":"f726ca1b-bccd-45cb-ba52-56484741b901","401":"abe84ebb-4111-4a3b-a03d-04a2842b287f"},"tags":["Sales"],"requestBody":"fb60c81b-d69e-44e8-9523-b0b3bc9201a0","description":"Create or update a sales invoice in Altera via the OpenAPI. Set basicInformation.statusId to ISSUED to issue, or save the document as a draft.","method":"post","type":"path","servers":["a409ea3f-45e8-468d-8b8a-ee4ed5128e59"],"security":["7e698552-bf4a-4d23-bf33-7d454e0d71b2"],"path":"/sales/invoice","baseUrlOptions":["https://api.altera.co"],"title":"Create/update invoice","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","x-examples":{"Example 1":{"modelType":"INVOICE","override":false,"basicInformation":{"invoiceId":2069,"invoiceType":"SALES","invoiceFormat":"%N/%M/%Y","saleDate":"2022-10-11","issueDate":"2022-10-11","isReceipt":false,"relatedInvoicesIds":[],"priceTypeId":"NET"},"contractor":{"contractorRegion":"POLAND","country":"PL","contractorType":"COMPANY","contractorName":"Test działania","street":"Testowa","houseNumber":"10","flatNumber":"10","city":"Bydgoszcz","postCode":"62-156","defaultCurrency":"PLN","taxIdentificationNumber":"1589651654","email":"testing@attention.please","areaNumber":"+58","phoneNumber":"518 961 516"},"invoicePosition":[{"productPosition":0,"productName":"A","positionType":"PRODUCT","productCategory":"Health","quantity":10,"unit":"szt.","priceType":null,"unitNetPrice":150,"unitGrossPrice":184.5,"vat":"23%","pkwiu":"","discount":"0","deductions":false,"netPrice":"1500","grossPrice":"1845","invoiceProductId":179}],"additionalDetails":"","correctionReason":"","payments":{"isPaid":false,"paymentMethod":"TRANSFER","dueDate":"2022-10-25","bankAccountNumber":"10 1010 1062 5565 1561 5615 1516","isSplitPayment":false},"project":{"tagId":161,"name":"Website implementation","enabled":true,"color":4286963618}}},"examples":[{"modelType":"INVOICE","override":false,"basicInformation":{"invoiceType":"SALES","invoiceFormat":"%N/%M/%Y","saleDate":"2022-10-11","issueDate":"2022-10-11","isReceipt":false,"relatedInvoicesIds":[],"priceTypeId":"NET","statusId":"DRAFT"},"contractor":{"contractorRegion":"POLAND","country":"PL","contractorType":"COMPANY","contractorName":"Test działania","street":"Testowa","houseNumber":"10","flatNumber":"10","city":"Bydgoszcz","postCode":"62-156","defaultCurrency":"PLN","taxIdentificationNumber":"1589651654","email":"testing@attention.please","areaNumber":"+58","phoneNumber":"518 961 516"},"invoicePosition":[{"productPosition":0,"productName":"A","positionType":"PRODUCT","productCategory":"Health","quantity":10,"unit":"szt.","unitNetPrice":150,"unitGrossPrice":184.5,"vat":"23%","pkwiu":"","discount":"0","deductions":false,"netPrice":"1500","grossPrice":"1845","invoiceProductId":179}],"additionalDetails":"","correctionReason":"","payments":{"isPaid":false,"paymentMethod":"TRANSFER","dueDate":"2022-10-25","bankAccountNumber":"10 1010 1062 5565 1561 5615 1516","isSplitPayment":false}},{"modelType":"INVOICE","override":false,"sendToKSEF":true,"basicInformation":{"invoiceId":2069,"invoiceType":"SALES","invoiceFormat":"%N/%M/%Y","saleDate":"2022-10-11","issueDate":"2022-10-11","isReceipt":false,"relatedInvoicesIds":[],"priceTypeId":"NET","statusId":"ISSUED"},"contractor":{"contractorRegion":"POLAND","country":"PL","contractorType":"COMPANY","contractorName":"Test działania","street":"Testowa","houseNumber":"10","flatNumber":"10","city":"Bydgoszcz","postCode":"62-156","defaultCurrency":"PLN","taxIdentificationNumber":"1589651654","email":"testing@attention.please","areaNumber":"+58","phoneNumber":"518 961 516"},"invoicePosition":[{"productPosition":0,"productName":"A","positionType":"PRODUCT","productCategory":"Health","quantity":10,"unit":"szt.","unitNetPrice":150,"unitGrossPrice":184.5,"vat":"23%","pkwiu":"","discount":"0","deductions":false,"netPrice":"1500","grossPrice":"1845","invoiceProductId":179}],"additionalDetails":"","correctionReason":"","payments":{"isPaid":false,"paymentMethod":"TRANSFER","dueDate":"2022-10-25","bankAccountNumber":"10 1010 1062 5565 1561 5615 1516","isSplitPayment":false}}],"properties":{"override":{"type":"boolean","default":false,"description":"Defines whether we wish to override split payments warning, in Machine-machine integrations should be set to `true`","uniqueKey":"override","typeLabel":"boolean"},"sendToKSEF":{"type":"boolean","description":"Request immediate KSeF submission after saving an eligible ISSUED or SENT invoice. Defaults to false; false does not disable normal automatic KSeF processing. Requires KSeF and outgoing submission enabled for the company and an eligible invoice. Does not issue a DRAFT or guarantee KSeF acceptance. Inspect data.ksefWarning, data.ksefErrorMessage and data.ksefReason even on HTTP 200, then check the saved invoice KSeF status. Not allowed for PRO_FORMA, ORDER or DEBIT_NOTE. See the endpoint guide for examples and retry handling.","default":false,"uniqueKey":"sendToKSEF","typeLabel":"boolean"},"basicInformation":{"type":"object","required":["invoiceType","invoiceFormat","saleDate","issueDate","priceTypeId"],"properties":{"invoiceType":{"type":"string","enum":["SALES","PRO_FORMA","INTERIM","INTERIM_FINAL","CORRECTION"],"example":"SALES","description":"The type of invoice we wish to create","isRequired":true,"uniqueKey":"basicInformation.invoiceType","typeLabel":"enum\u003cstring>"},"invoiceFormat":{"type":"string","example":"%N/%M/%Y","description":"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","isRequired":true,"uniqueKey":"basicInformation.invoiceFormat","typeLabel":"string"},"saleDate":{"type":"string","format":"date","description":"Sale date as a calendar date in YYYY-MM-DD format, without a time or time zone. Do not convert it to a UTC timestamp.","example":"2026-09-14","isRequired":true,"uniqueKey":"basicInformation.saleDate","typeLabel":"string\u003cdate>"},"issueDate":{"type":"string","format":"date","description":"Issue date as a calendar date in YYYY-MM-DD format, without a time or time zone. Do not convert it to a UTC timestamp.","example":"2026-09-14","isRequired":true,"uniqueKey":"basicInformation.issueDate","typeLabel":"string\u003cdate>"},"priceTypeId":{"type":"string","enum":["NET","GROSS"],"default":"NET","example":"NET","isRequired":true,"uniqueKey":"basicInformation.priceTypeId","typeLabel":"enum\u003cstring>"},"invoiceId":{"type":"integer","description":"Invoice identificator, used for updating documents","uniqueKey":"basicInformation.invoiceId","typeLabel":"integer"},"isReceipt":{"type":"boolean","description":"Defines whether we are creating an invoice to an already issued receipt","uniqueKey":"basicInformation.isReceipt","typeLabel":"boolean"},"relatedInvoicesIds":{"type":"array","description":"Identifiers of documents related to this invoice. For CORRECTION, the first referenced invoice supplies the baseline rows. To correct a previous correction, reference that correction and provide the new after-correction state. GET /sales/invoice with related prepares a starting payload from the referenced document.","items":{"type":"object","uniqueKey":"basicInformation.relatedInvoicesIds.items.[INDEX]","typeLabel":"object"},"uniqueKey":"basicInformation.relatedInvoicesIds","typeLabel":"object[]"},"statusId":{"x-stoplight":{"id":"94k63xf3cdiyb"},"example":"ISSUED","enum":["DRAFT","ISSUED"],"default":"DRAFT","type":"string","uniqueKey":"basicInformation.statusId","typeLabel":"enum\u003cstring>"},"currency":{"type":"string","minLength":3,"maxLength":3,"example":"EUR","description":"Invoice currency as a three-letter code, for example PLN, EUR or USD. Input is trimmed and converted to uppercase. If omitted, Altera uses contractor.defaultCurrency, then PLN. Resend it on update to retain the invoice currency.","uniqueKey":"basicInformation.currency","typeLabel":"string"},"language":{"type":"string","enum":["pl","en","de","es","en_pl","de_pl"],"default":"pl","example":"en","description":"Language of the invoice document: Polish, English, German, Spanish, English/Polish or German/Polish. Independent of the email content language. If omitted, defaults to pl, including on update.","uniqueKey":"basicInformation.language","typeLabel":"enum\u003cstring>"}},"uniqueKey":"basicInformation","typeLabel":"object"},"contractor":{"type":"object","properties":{"contractorRegion":{"type":"string","enum":["EU","OUTSIDE_OF_EU","POLAND"],"example":"POLAND","uniqueKey":"contractor.contractorRegion","typeLabel":"enum\u003cstring>"},"country":{"type":"string","maxLength":2,"example":"PL","description":"ISO 3166-1 alfa-2 two letter country code","uniqueKey":"contractor.country","typeLabel":"string"},"contractorType":{"type":"string","enum":["COMPANY","PRIVATE_PERSON"],"example":"COMPANY","uniqueKey":"contractor.contractorType","typeLabel":"enum\u003cstring>"},"contractorName":{"type":"string","uniqueKey":"contractor.contractorName","typeLabel":"string"},"street":{"type":"string","uniqueKey":"contractor.street","typeLabel":"string"},"houseNumber":{"type":"string","uniqueKey":"contractor.houseNumber","typeLabel":"string"},"flatNumber":{"type":"string","uniqueKey":"contractor.flatNumber","typeLabel":"string"},"city":{"type":"string","uniqueKey":"contractor.city","typeLabel":"string"},"postCode":{"type":"string","uniqueKey":"contractor.postCode","typeLabel":"string"},"defaultCurrency":{"type":"string","uniqueKey":"contractor.defaultCurrency","typeLabel":"string"},"taxIdentificationNumber":{"type":"string","maxLength":45,"uniqueKey":"contractor.taxIdentificationNumber","typeLabel":"string"},"email":{"type":"string","maxLength":200,"description":"Comma delimited list of contractor e-mails","uniqueKey":"contractor.email","typeLabel":"string"},"areaNumber":{"type":"string","maxLength":5,"uniqueKey":"contractor.areaNumber","typeLabel":"string"},"phoneNumber":{"type":"string","maxLength":45,"uniqueKey":"contractor.phoneNumber","typeLabel":"string"}},"uniqueKey":"contractor","typeLabel":"object"},"invoicePosition":{"type":"array","items":{"type":"object","properties":{"productPosition":{"type":"integer","example":0,"description":"Zero based position number in invoice","uniqueKey":"invoicePosition.items.[INDEX].productPosition","typeLabel":"integer"},"productName":{"type":"string","maxLength":200,"uniqueKey":"invoicePosition.items.[INDEX].productName","typeLabel":"string"},"positionType":{"type":"string","enum":["PRODUCT","SERVICE"],"example":"SERVICE","uniqueKey":"invoicePosition.items.[INDEX].positionType","typeLabel":"enum\u003cstring>"},"productCategory":{"type":"string","description":"Allows grouping of similar products","example":"Personalized","uniqueKey":"invoicePosition.items.[INDEX].productCategory","typeLabel":"string"},"quantity":{"type":"number","example":14,"description":"Positive on ordinary invoices. Zero is accepted only for CORRECTION with a source invoice in basicInformation.relatedInvoicesIds, for the state after correction. Negative quantities are rejected.","minimum":0,"uniqueKey":"invoicePosition.items.[INDEX].quantity","typeLabel":"number"},"unit":{"type":"string","example":"pcs.","uniqueKey":"invoicePosition.items.[INDEX].unit","typeLabel":"string"},"unitNetPrice":{"type":"number","description":"Net price per item. Zero is accepted, including for the post-correction state of a fully returned line.","example":100,"minimum":0,"uniqueKey":"invoicePosition.items.[INDEX].unitNetPrice","typeLabel":"number"},"unitGrossPrice":{"type":"number","description":"Gross price per item. Zero is accepted, including for the post-correction state of a fully returned line.","example":123,"minimum":0,"uniqueKey":"invoicePosition.items.[INDEX].unitGrossPrice","typeLabel":"number"},"vat":{"type":"string","enum":["23%","8%","5%","0%","np I","np II","np","zw"],"example":"23%","description":"VAT rate for this invoice line. np I and np II are distinct supported values and map to separate KSeF summary fields P_13_8 and P_13_9. The generic np value is retained for legacy invoices and maps to np I; use an explicit np I or np II value for new invoices.","uniqueKey":"invoicePosition.items.[INDEX].vat","typeLabel":"enum\u003cstring>"},"pkwiu":{"type":"string","uniqueKey":"invoicePosition.items.[INDEX].pkwiu","typeLabel":"string"},"discount":{"type":"string","example":"10%","description":"Defines % discount on given product","uniqueKey":"invoicePosition.items.[INDEX].discount","typeLabel":"string"},"invoiceProductId":{"type":"integer","uniqueKey":"invoicePosition.items.[INDEX].invoiceProductId","typeLabel":"integer"},"gtu":{"oneOf":[{"type":"string","maxLength":10,"example":"2","description":"Optional GTU classification for this invoice line. Use a string from 1 to 13, for example \"2\"; zero-padded values such as \"02\" and KSeF values such as \"GTU_02\" are also supported. KSeF export converts the numeric value to GTU_01 through GTU_13. Omit, pass null or an empty string when no GTU applies.","uniqueKey":"invoicePosition.items.[INDEX].gtu.oneOf.0","typeLabel":"string"},{"type":"null","maxLength":10,"example":"2","description":"Optional GTU classification for this invoice line. Use a string from 1 to 13, for example \"2\"; zero-padded values such as \"02\" and KSeF values such as \"GTU_02\" are also supported. KSeF export converts the numeric value to GTU_01 through GTU_13. Omit, pass null or an empty string when no GTU applies.","uniqueKey":"invoicePosition.items.[INDEX].gtu.oneOf.1","typeLabel":"null"}],"uniqueKey":"invoicePosition.items.[INDEX].gtu","typeLabel":"string | null"}},"uniqueKey":"invoicePosition.items.[INDEX]","typeLabel":"object"},"uniqueKey":"invoicePosition","typeLabel":"object[]"},"additionalDetails":{"type":"string","description":"Describes extra information that we wish to present on the invoice","uniqueKey":"additionalDetails","typeLabel":"string"},"correctionReason":{"type":"string","description":"Additional information regarding the reason behing correcting your invoice","uniqueKey":"correctionReason","typeLabel":"string"},"vatExemptionReason":{"type":"string","maxLength":50,"enum":["Zwolnienie podmiotowe z art. 113 ust. 1 i 9","Zwolnienie przedmiotowe z art. 43 ust. 1","Zwolnienie przedmiotowe z art. 82 ust. 3"],"description":"Legal basis for a zw line. Required before issuing a sales invoice unless a nonempty company default supplies the basis. Drafts may omit it. Missing basis returns validation code KSEF_VAT_EXEMPTION_LEGAL_BASIS_REQUIRED, which override cannot bypass. New XML uses P_19A. Submission also checks stored XML for P_19=1, exactly one nonempty P_19A/B/C, and no P_19N.","uniqueKey":"vatExemptionReason","typeLabel":"enum\u003cstring>"},"vatExemptionReasonDetailed":{"type":"string","maxLength":500,"description":"Optional detailed wording shown on the invoice below vatExemptionReason. It does not replace the required vatExemptionReason value.","uniqueKey":"vatExemptionReasonDetailed","typeLabel":"string"},"payments":{"type":"object","properties":{"isPaid":{"type":"boolean","isRequired":true,"uniqueKey":"payments.isPaid","typeLabel":"boolean"},"paymentMethod":{"type":"string","enum":["TRANSFER","CASH","CARD"],"example":"TRANSFER","isRequired":true,"uniqueKey":"payments.paymentMethod","typeLabel":"enum\u003cstring>"},"dueDate":{"type":"string","format":"date","description":"Payment due date as a calendar date in YYYY-MM-DD format, without a time or time zone. Do not convert it to a UTC timestamp.","example":"2026-09-28","isRequired":true,"uniqueKey":"payments.dueDate","typeLabel":"string\u003cdate>"},"isSplitPayment":{"type":"boolean","description":"Required whenever payments is provided. Pass false when split payment does not apply.","isRequired":true,"uniqueKey":"payments.isSplitPayment","typeLabel":"boolean"},"bankAccountNumber":{"type":"string","description":"Defines the bank account no. we wish to receive funds to","uniqueKey":"payments.bankAccountNumber","typeLabel":"string"},"paymentDate":{"type":"string","format":"date","description":"Payment date (optional) as a calendar date in YYYY-MM-DD format, without a time or time zone. Do not convert it to a UTC timestamp.","example":"2026-09-14","uniqueKey":"payments.paymentDate","typeLabel":"string\u003cdate>"}},"required":["paymentMethod","dueDate","isSplitPayment","isPaid"],"description":"Required when statusId is not DRAFT. Whenever this object is supplied, include paymentMethod, dueDate, isSplitPayment and isPaid, including explicit false values for the booleans.","uniqueKey":"payments","typeLabel":"object"},"additionalParties":{"type":"array","description":"Additional parties, including a separate recipient (Podmiot3). Each entry is a snapshot; contractor continues to identify the buyer.","items":{"type":"object","description":"Snapshot of an additional invoice party (Podmiot3). The buyer remains in contractor. Provide the party name, role, address and applicable tax identity for invoicing and KSeF export.","properties":{"semanticRole":{"type":"string","enum":["FACTOR","RECIPIENT","BRANCH","ORIGINAL_ENTITY","ADDITIONAL_BUYER","ISSUER","PAYEE","JST_ISSUER","JST_RECIPIENT","VAT_GROUP_ISSUER","VAT_GROUP_RECIPIENT","EMPLOYEE","OTHER"],"description":"Role of this additional party (Podmiot3). Use RECIPIENT for a separate invoice recipient. JST_RECIPIENT has distinct KSeF semantics; do not select it solely because the recipient is a school.","uniqueKey":"additionalParties.items.[INDEX].semanticRole","typeLabel":"enum\u003cstring>"},"internalId":{"oneOf":[{"type":"string","pattern":"^[0-9]{5}$","description":"Optional five-digit suffix, preserving leading zeros. KSeF export requires a Polish 10-digit NIP and Polish country and emits IDWew as NIP-internalId, for example 5260250274-00123.","uniqueKey":"additionalParties.items.[INDEX].internalId.oneOf.0","typeLabel":"string"},{"type":"null","pattern":"^[0-9]{5}$","description":"Optional five-digit suffix, preserving leading zeros. KSeF export requires a Polish 10-digit NIP and Polish country and emits IDWew as NIP-internalId, for example 5260250274-00123.","uniqueKey":"additionalParties.items.[INDEX].internalId.oneOf.1","typeLabel":"null"}],"uniqueKey":"additionalParties.items.[INDEX].internalId","typeLabel":"string | null"},"contractorType":{"type":"string","enum":["COMPANY","PRIVATE_PERSON"],"uniqueKey":"additionalParties.items.[INDEX].contractorType","typeLabel":"enum\u003cstring>"},"contractorRegion":{"type":"string","enum":["POLAND","EU","OUTSIDE_OF_EU"],"uniqueKey":"additionalParties.items.[INDEX].contractorRegion","typeLabel":"enum\u003cstring>"},"contractorName":{"type":"string","maxLength":255,"uniqueKey":"additionalParties.items.[INDEX].contractorName","typeLabel":"string"},"taxIdentificationNumber":{"type":"string","maxLength":45,"uniqueKey":"additionalParties.items.[INDEX].taxIdentificationNumber","typeLabel":"string"},"city":{"type":"string","maxLength":100,"uniqueKey":"additionalParties.items.[INDEX].city","typeLabel":"string"},"street":{"type":"string","maxLength":100,"uniqueKey":"additionalParties.items.[INDEX].street","typeLabel":"string"},"houseNumber":{"type":"string","maxLength":20,"uniqueKey":"additionalParties.items.[INDEX].houseNumber","typeLabel":"string"},"flatNumber":{"type":"string","maxLength":20,"uniqueKey":"additionalParties.items.[INDEX].flatNumber","typeLabel":"string"},"postCode":{"type":"string","maxLength":10,"uniqueKey":"additionalParties.items.[INDEX].postCode","typeLabel":"string"},"email":{"type":"string","maxLength":500,"uniqueKey":"additionalParties.items.[INDEX].email","typeLabel":"string"},"phoneNumber":{"type":"string","maxLength":45,"uniqueKey":"additionalParties.items.[INDEX].phoneNumber","typeLabel":"string"},"areaNumber":{"type":"string","maxLength":5,"uniqueKey":"additionalParties.items.[INDEX].areaNumber","typeLabel":"string"},"roleOther":{"type":"string","maxLength":255,"description":"Description of the role when semanticRole is OTHER; exported as OpisRoli with RolaInna=1.","uniqueKey":"additionalParties.items.[INDEX].roleOther","typeLabel":"string"},"extraInfo":{"type":"string","maxLength":255,"uniqueKey":"additionalParties.items.[INDEX].extraInfo","typeLabel":"string"},"country":{"type":"string","minLength":2,"maxLength":2,"uniqueKey":"additionalParties.items.[INDEX].country","typeLabel":"string"},"tinCountry":{"type":"string","minLength":2,"maxLength":2,"uniqueKey":"additionalParties.items.[INDEX].tinCountry","typeLabel":"string"},"defaultCurrency":{"type":"string","minLength":3,"maxLength":3,"uniqueKey":"additionalParties.items.[INDEX].defaultCurrency","typeLabel":"string"},"partyOrder":{"type":"integer","minimum":0,"description":"Optional display order; defaults to the zero-based position in additionalParties.","uniqueKey":"additionalParties.items.[INDEX].partyOrder","typeLabel":"integer"},"sharePercent":{"type":"number","minimum":0,"maximum":100,"description":"Optional share percentage for the additional party.","uniqueKey":"additionalParties.items.[INDEX].sharePercent","typeLabel":"number"}},"uniqueKey":"additionalParties.items.[INDEX]","typeLabel":"object"},"uniqueKey":"additionalParties","typeLabel":"object[]"},"project":{"type":"object","title":"","description":"Single project assigned to the invoice. Pass an existing project from the same company, including tagId, name, enabled and color. Assignment is persisted by tagId; saving an invoice does not create a project. On update, resend project to retain the assignment; omitting it removes the assignment. The header project is propagated to sales line items. Use project, not projects.","required":["tagId","name","enabled","color"],"x-examples":{"Example 1":{"tagId":1,"name":"Marketing","enabled":false,"color":4286963618}},"example":{"tagId":161,"name":"Website implementation","enabled":true,"color":4286963618},"properties":{"tagId":{"type":"integer","minimum":1,"isRequired":true,"uniqueKey":"project.tagId","typeLabel":"integer"},"name":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"project.name","typeLabel":"string"},"enabled":{"type":"boolean","isRequired":true,"uniqueKey":"project.enabled","typeLabel":"boolean"},"color":{"type":"integer","maximum":4294967295,"minimum":4278190080,"isRequired":true,"uniqueKey":"project.color","typeLabel":"integer"}},"uniqueKey":"project","typeLabel":"object"}},"description":"","uniqueKey":"","typeLabel":"object"},"examples":{"Example 1":{"title":"Example 1","value":{"modelType":"INVOICE","override":false,"basicInformation":{"invoiceId":2069,"invoiceType":"SALES","invoiceFormat":"%N/%M/%Y","saleDate":"2022-10-11","issueDate":"2022-10-11","isReceipt":false,"relatedInvoicesIds":[],"priceTypeId":"NET"},"contractor":{"contractorRegion":"POLAND","country":"PL","contractorType":"COMPANY","contractorName":"Test działania","street":"Testowa","houseNumber":"10","flatNumber":"10","city":"Bydgoszcz","postCode":"62-156","defaultCurrency":"PLN","taxIdentificationNumber":"1589651654","email":"testing@attention.please","areaNumber":"+58","phoneNumber":"518 961 516"},"invoicePosition":[{"productPosition":0,"productName":"A","positionType":"PRODUCT","productCategory":"Health","quantity":10,"unit":"szt.","priceType":null,"unitNetPrice":150,"unitGrossPrice":184.5,"vat":"23%","pkwiu":"","discount":"0","deductions":false,"netPrice":"1500","grossPrice":"1845","invoiceProductId":179}],"additionalDetails":"","correctionReason":"","payments":{"isPaid":false,"paymentMethod":"TRANSFER","dueDate":"2022-10-25","bankAccountNumber":"10 1010 1062 5565 1561 5615 1516","isSplitPayment":false},"project":{"tagId":161,"name":"Website implementation","enabled":true,"color":4286963618}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"68643623-08e9-44cc-96c4-74e99d603c57":{"description":"Invoice saved. HTTP 200 confirms the save, not acceptance by KSeF. A failed immediate submission can be reported in optional data.ksefWarning, data.ksefErrorMessage and data.ksefReason fields.","content":{"application/json":{"schema":{"type":"object","title":"SuccessResponse","description":"Regular format of success response in Altera API\nRetrieved information will always be stored in the 'data' node","x-stoplight":{"id":"wfh8d9tigst1z"},"example":{"result":"OK","data":{"invoiceId":12413}},"properties":{"data":{"type":"object","title":"Invoice","description":"Invoice model for objects returned from server","required":["invoiceId"],"x-examples":{"Example 1":{"modelType":"INVOICE","readOnly":false,"basicInformation":{"invoiceId":118584,"invoiceType":"PRO_FORMA","invoiceFormat":"PRO %N/%M/%Y","invoiceNumber":"PRO 2/12/2022","year":2022,"month":12,"invoiceNumberInPeriod":2,"statusId":"SENT","isReceipt":false,"isRelated":false,"netPrice":5760,"grossPrice":7084.8,"currency":"PLN","exchangeRate":1.43,"vatPLN":1324.8,"issueDate":"2022-12-27T00:00:00.000Z","saleDate":"2022-12-27T00:00:00.000Z","uploadDate":"2022-12-27T08:52:22.000Z","relatedInvoicesIds":[],"priceTypeId":"NET"},"buyer":{"contractorName":"American Water Works Company, Inc.","contractorId":106,"taxIdentificationNumber":"3748414103","country":"PL","contractorType":"COMPANY","contractorRegion":"POLAND","defaultCurrency":"PLN","city":"Norton Canes","street":"Dezsez View","houseNumber":"396","flatNumber":"154","postCode":"97-135","email":"went@able.com,fv@altera.co","phoneNumber":"420577850","areaNumber":""},"seller":{"taxIdentificationNumber":"1397887352","contractorName":"Express Scripts Inc."},"payments":{"paymentMethod":"TRANSFER","dueDate":"2023-01-26T00:00:00.000Z","isSplitPayment":false,"isPaid":false,"paidAmount":0,"bankAccountNumber":"29 1111 1111 1111 1111 1111 1111"},"invoicePosition":[{"invoiceProductId":57822,"positionType":"SERVICE","productPosition":0,"productCategory":"Facebook","productCategoryId":808,"productName":"Facebook Ads","unit":"szt.","unitNetPrice":480,"unitGrossPrice":590.4,"quantity":12,"discount":0,"vat":"23%","priceNet":5760,"netPrice":"5760","vatAmt":1324.8,"priceGross":7084.8,"grossPrice":"7084.8","gtu":"-"}]}},"x-stoplight":{"id":"i58aambagr5xn"},"properties":{"invoiceId":{"type":"number","x-stoplight":{"id":"ng63zj0yg4qvv"},"example":12413,"isRequired":true,"uniqueKey":"data.invoiceId","typeLabel":"number"},"modelType":{"type":"string","uniqueKey":"data.modelType","typeLabel":"string"},"readOnly":{"type":"boolean","uniqueKey":"data.readOnly","typeLabel":"boolean"},"basicInformation":{"type":"object","properties":{"invoiceId":{"type":"integer","isRequired":true,"uniqueKey":"data.basicInformation.invoiceId","typeLabel":"integer"},"invoiceType":{"type":"string","enum":["SALES","PRO_FORMA","INTERIM","INTERIM_FINAL","CORRECTION"],"example":"SALES","isRequired":true,"uniqueKey":"data.basicInformation.invoiceType","typeLabel":"enum\u003cstring>"},"invoiceFormat":{"type":"string","isRequired":true,"uniqueKey":"data.basicInformation.invoiceFormat","typeLabel":"string"},"year":{"type":"integer","isRequired":true,"uniqueKey":"data.basicInformation.year","typeLabel":"integer"},"month":{"type":"integer","isRequired":true,"uniqueKey":"data.basicInformation.month","typeLabel":"integer"},"invoiceNumber":{"type":"string","uniqueKey":"data.basicInformation.invoiceNumber","typeLabel":"string"},"invoiceNumberInPeriod":{"type":"integer","uniqueKey":"data.basicInformation.invoiceNumberInPeriod","typeLabel":"integer"},"statusId":{"type":"string","uniqueKey":"data.basicInformation.statusId","typeLabel":"string"},"isReceipt":{"type":"boolean","uniqueKey":"data.basicInformation.isReceipt","typeLabel":"boolean"},"isRelated":{"type":"boolean","uniqueKey":"data.basicInformation.isRelated","typeLabel":"boolean"},"netPrice":{"type":"integer","uniqueKey":"data.basicInformation.netPrice","typeLabel":"integer"},"grossPrice":{"type":"number","uniqueKey":"data.basicInformation.grossPrice","typeLabel":"number"},"currency":{"type":"string","minLength":3,"maxLength":3,"example":"EUR","description":"Invoice currency stored as a three-letter code.","uniqueKey":"data.basicInformation.currency","typeLabel":"string"},"exchangeRate":{"type":"number","uniqueKey":"data.basicInformation.exchangeRate","typeLabel":"number"},"vatPLN":{"type":"number","uniqueKey":"data.basicInformation.vatPLN","typeLabel":"number"},"issueDate":{"type":"string","uniqueKey":"data.basicInformation.issueDate","typeLabel":"string"},"saleDate":{"type":"string","uniqueKey":"data.basicInformation.saleDate","typeLabel":"string"},"uploadDate":{"type":"string","uniqueKey":"data.basicInformation.uploadDate","typeLabel":"string"},"relatedInvoicesIds":{"type":"array","items":{"type":"object","uniqueKey":"data.basicInformation.relatedInvoicesIds.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.basicInformation.relatedInvoicesIds","typeLabel":"object[]"},"priceTypeId":{"type":"string","uniqueKey":"data.basicInformation.priceTypeId","typeLabel":"string"},"language":{"type":"string","enum":["pl","en","de","es","en_pl","de_pl"],"default":"pl","example":"en","description":"Language of the invoice document: pl, en, de, es, en_pl or de_pl.","uniqueKey":"data.basicInformation.language","typeLabel":"enum\u003cstring>"},"isDeleted":{"oneOf":[{"type":"boolean","description":"Soft-deletion marker. Public GET excludes soft-deleted documents and returns 404 instead of their data.","uniqueKey":"data.basicInformation.isDeleted.oneOf.0","typeLabel":"boolean"},{"type":"integer","description":"Soft-deletion marker. Public GET excludes soft-deleted documents and returns 404 instead of their data.","enum":[0,1],"uniqueKey":"data.basicInformation.isDeleted.oneOf.1","typeLabel":"enum\u003cinteger>"}],"uniqueKey":"data.basicInformation.isDeleted","typeLabel":"boolean | enum\u003cinteger>"}},"required":["invoiceId","invoiceType","invoiceFormat","year","month"],"uniqueKey":"data.basicInformation","typeLabel":"object"},"contractor":{"type":"object","x-stoplight":{"id":"3h79oxtj5267w"},"properties":{"contractorName":{"type":"string","uniqueKey":"data.contractor.contractorName","typeLabel":"string"},"contractorId":{"type":"integer","uniqueKey":"data.contractor.contractorId","typeLabel":"integer"},"taxIdentificationNumber":{"type":"string","uniqueKey":"data.contractor.taxIdentificationNumber","typeLabel":"string"},"country":{"type":"string","uniqueKey":"data.contractor.country","typeLabel":"string"},"contractorType":{"type":"string","uniqueKey":"data.contractor.contractorType","typeLabel":"string"},"contractorRegion":{"type":"string","uniqueKey":"data.contractor.contractorRegion","typeLabel":"string"},"defaultCurrency":{"type":"string","uniqueKey":"data.contractor.defaultCurrency","typeLabel":"string"},"city":{"type":"string","uniqueKey":"data.contractor.city","typeLabel":"string"},"street":{"type":"string","uniqueKey":"data.contractor.street","typeLabel":"string"},"houseNumber":{"type":"string","uniqueKey":"data.contractor.houseNumber","typeLabel":"string"},"flatNumber":{"type":"string","uniqueKey":"data.contractor.flatNumber","typeLabel":"string"},"postCode":{"type":"string","uniqueKey":"data.contractor.postCode","typeLabel":"string"},"email":{"type":"string","uniqueKey":"data.contractor.email","typeLabel":"string"},"phoneNumber":{"type":"string","uniqueKey":"data.contractor.phoneNumber","typeLabel":"string"},"areaNumber":{"type":"string","uniqueKey":"data.contractor.areaNumber","typeLabel":"string"}},"uniqueKey":"data.contractor","typeLabel":"object"},"seller":{"type":"object","properties":{"taxIdentificationNumber":{"type":"string","uniqueKey":"data.seller.taxIdentificationNumber","typeLabel":"string"},"contractorName":{"type":"string","uniqueKey":"data.seller.contractorName","typeLabel":"string"}},"uniqueKey":"data.seller","typeLabel":"object"},"payments":{"type":"object","properties":{"paymentMethod":{"type":"string","uniqueKey":"data.payments.paymentMethod","typeLabel":"string"},"dueDate":{"type":"string","uniqueKey":"data.payments.dueDate","typeLabel":"string"},"isSplitPayment":{"type":"boolean","uniqueKey":"data.payments.isSplitPayment","typeLabel":"boolean"},"isPaid":{"type":"boolean","uniqueKey":"data.payments.isPaid","typeLabel":"boolean"},"paidAmount":{"type":"integer","uniqueKey":"data.payments.paidAmount","typeLabel":"integer"},"bankAccountNumber":{"type":"string","uniqueKey":"data.payments.bankAccountNumber","typeLabel":"string"}},"uniqueKey":"data.payments","typeLabel":"object"},"ksef":{"type":"object","properties":{"ksefId":{"type":"string","uniqueKey":"data.ksef.ksefId","typeLabel":"string"},"ksefSubmissionDate":{"type":"string","uniqueKey":"data.ksef.ksefSubmissionDate","typeLabel":"string"},"ksefStatus":{"type":"string","enum":["ACCEPTED","PENDING","ERROR"],"uniqueKey":"data.ksef.ksefStatus","typeLabel":"enum\u003cstring>"},"ksefErrorMessage":{"type":"string","uniqueKey":"data.ksef.ksefErrorMessage","typeLabel":"string"},"ksefRetryCount":{"type":"integer","uniqueKey":"data.ksef.ksefRetryCount","typeLabel":"integer"},"ksefSourceXmlKey":{"type":"string","uniqueKey":"data.ksef.ksefSourceXmlKey","typeLabel":"string"}},"uniqueKey":"data.ksef","typeLabel":"object"},"offlineMode":{"type":"boolean","uniqueKey":"data.offlineMode","typeLabel":"boolean"},"offlineModeReason":{"type":"string","uniqueKey":"data.offlineModeReason","typeLabel":"string"},"invoicePosition":{"type":"array","items":{"type":"object","properties":{"invoiceProductId":{"type":"integer","uniqueKey":"data.invoicePosition.items.[INDEX].invoiceProductId","typeLabel":"integer"},"positionType":{"type":"string","uniqueKey":"data.invoicePosition.items.[INDEX].positionType","typeLabel":"string"},"productPosition":{"type":"integer","uniqueKey":"data.invoicePosition.items.[INDEX].productPosition","typeLabel":"integer"},"productCategory":{"type":"string","uniqueKey":"data.invoicePosition.items.[INDEX].productCategory","typeLabel":"string"},"productCategoryId":{"type":"integer","uniqueKey":"data.invoicePosition.items.[INDEX].productCategoryId","typeLabel":"integer"},"productName":{"type":"string","uniqueKey":"data.invoicePosition.items.[INDEX].productName","typeLabel":"string"},"unit":{"type":"string","uniqueKey":"data.invoicePosition.items.[INDEX].unit","typeLabel":"string"},"unitNetPrice":{"type":"integer","uniqueKey":"data.invoicePosition.items.[INDEX].unitNetPrice","typeLabel":"integer"},"unitGrossPrice":{"type":"number","uniqueKey":"data.invoicePosition.items.[INDEX].unitGrossPrice","typeLabel":"number"},"quantity":{"type":"integer","uniqueKey":"data.invoicePosition.items.[INDEX].quantity","typeLabel":"integer"},"discount":{"type":"integer","uniqueKey":"data.invoicePosition.items.[INDEX].discount","typeLabel":"integer"},"vat":{"type":"string","description":"VAT rate for this invoice line. np I and np II are distinct supported values and map to separate KSeF summary fields P_13_8 and P_13_9. The generic np value is retained for legacy invoices and maps to np I; use an explicit np I or np II value for new invoices.","uniqueKey":"data.invoicePosition.items.[INDEX].vat","typeLabel":"string"},"priceNet":{"type":"integer","uniqueKey":"data.invoicePosition.items.[INDEX].priceNet","typeLabel":"integer"},"netPrice":{"type":"string","uniqueKey":"data.invoicePosition.items.[INDEX].netPrice","typeLabel":"string"},"vatAmt":{"type":"number","uniqueKey":"data.invoicePosition.items.[INDEX].vatAmt","typeLabel":"number"},"priceGross":{"type":"number","uniqueKey":"data.invoicePosition.items.[INDEX].priceGross","typeLabel":"number"},"grossPrice":{"type":"string","uniqueKey":"data.invoicePosition.items.[INDEX].grossPrice","typeLabel":"string"},"gtu":{"oneOf":[{"type":"string","maxLength":10,"example":"2","description":"Optional GTU classification for this invoice line. Use a string from 1 to 13, for example \"2\"; zero-padded values such as \"02\" and KSeF values such as \"GTU_02\" are also supported. KSeF export converts the numeric value to GTU_01 through GTU_13. Omit, pass null or an empty string when no GTU applies.","uniqueKey":"data.invoicePosition.items.[INDEX].gtu.oneOf.0","typeLabel":"string"},{"type":"null","maxLength":10,"example":"2","description":"Optional GTU classification for this invoice line. Use a string from 1 to 13, for example \"2\"; zero-padded values such as \"02\" and KSeF values such as \"GTU_02\" are also supported. KSeF export converts the numeric value to GTU_01 through GTU_13. Omit, pass null or an empty string when no GTU applies.","uniqueKey":"data.invoicePosition.items.[INDEX].gtu.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.invoicePosition.items.[INDEX].gtu","typeLabel":"string | null"}},"uniqueKey":"data.invoicePosition.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.invoicePosition","typeLabel":"object[]"},"vatExemptionReason":{"oneOf":[{"type":"string","maxLength":50,"enum":["Zwolnienie podmiotowe z art. 113 ust. 1 i 9","Zwolnienie przedmiotowe z art. 43 ust. 1","Zwolnienie przedmiotowe z art. 82 ust. 3"],"description":"Legal basis for VAT exemption selected for an invoice containing a line with the `zw` VAT rate.","uniqueKey":"data.vatExemptionReason.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","maxLength":50,"enum":["Zwolnienie podmiotowe z art. 113 ust. 1 i 9","Zwolnienie przedmiotowe z art. 43 ust. 1","Zwolnienie przedmiotowe z art. 82 ust. 3"],"description":"Legal basis for VAT exemption selected for an invoice containing a line with the `zw` VAT rate.","uniqueKey":"data.vatExemptionReason.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.vatExemptionReason","typeLabel":"enum\u003cstring> | null"},"vatExemptionReasonDetailed":{"oneOf":[{"type":"string","maxLength":500,"description":"Optional detailed wording shown on the invoice below the selected VAT exemption legal basis.","uniqueKey":"data.vatExemptionReasonDetailed.oneOf.0","typeLabel":"string"},{"type":"null","maxLength":500,"description":"Optional detailed wording shown on the invoice below the selected VAT exemption legal basis.","uniqueKey":"data.vatExemptionReasonDetailed.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.vatExemptionReasonDetailed","typeLabel":"string | null"},"additionalParties":{"type":"array","description":"Additional parties, including a separate recipient (Podmiot3). Each entry is a snapshot; contractor continues to identify the buyer.","items":{"type":"object","description":"Snapshot of an additional invoice party (Podmiot3). The buyer remains in contractor. Provide the party name, role, address and applicable tax identity for invoicing and KSeF export.","properties":{"semanticRole":{"type":"string","enum":["FACTOR","RECIPIENT","BRANCH","ORIGINAL_ENTITY","ADDITIONAL_BUYER","ISSUER","PAYEE","JST_ISSUER","JST_RECIPIENT","VAT_GROUP_ISSUER","VAT_GROUP_RECIPIENT","EMPLOYEE","OTHER"],"description":"Role of this additional party (Podmiot3). Use RECIPIENT for a separate invoice recipient. JST_RECIPIENT has distinct KSeF semantics; do not select it solely because the recipient is a school.","uniqueKey":"data.additionalParties.items.[INDEX].semanticRole","typeLabel":"enum\u003cstring>"},"internalId":{"oneOf":[{"type":"string","pattern":"^[0-9]{5}$","description":"Optional five-digit suffix, preserving leading zeros. KSeF export requires a Polish 10-digit NIP and Polish country and emits IDWew as NIP-internalId, for example 5260250274-00123.","uniqueKey":"data.additionalParties.items.[INDEX].internalId.oneOf.0","typeLabel":"string"},{"type":"null","pattern":"^[0-9]{5}$","description":"Optional five-digit suffix, preserving leading zeros. KSeF export requires a Polish 10-digit NIP and Polish country and emits IDWew as NIP-internalId, for example 5260250274-00123.","uniqueKey":"data.additionalParties.items.[INDEX].internalId.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.additionalParties.items.[INDEX].internalId","typeLabel":"string | null"},"contractorType":{"type":"string","enum":["COMPANY","PRIVATE_PERSON"],"uniqueKey":"data.additionalParties.items.[INDEX].contractorType","typeLabel":"enum\u003cstring>"},"contractorRegion":{"type":"string","enum":["POLAND","EU","OUTSIDE_OF_EU"],"uniqueKey":"data.additionalParties.items.[INDEX].contractorRegion","typeLabel":"enum\u003cstring>"},"contractorName":{"type":"string","maxLength":255,"uniqueKey":"data.additionalParties.items.[INDEX].contractorName","typeLabel":"string"},"taxIdentificationNumber":{"type":"string","maxLength":45,"uniqueKey":"data.additionalParties.items.[INDEX].taxIdentificationNumber","typeLabel":"string"},"city":{"type":"string","maxLength":100,"uniqueKey":"data.additionalParties.items.[INDEX].city","typeLabel":"string"},"street":{"type":"string","maxLength":100,"uniqueKey":"data.additionalParties.items.[INDEX].street","typeLabel":"string"},"houseNumber":{"type":"string","maxLength":20,"uniqueKey":"data.additionalParties.items.[INDEX].houseNumber","typeLabel":"string"},"flatNumber":{"type":"string","maxLength":20,"uniqueKey":"data.additionalParties.items.[INDEX].flatNumber","typeLabel":"string"},"postCode":{"type":"string","maxLength":10,"uniqueKey":"data.additionalParties.items.[INDEX].postCode","typeLabel":"string"},"email":{"type":"string","maxLength":500,"uniqueKey":"data.additionalParties.items.[INDEX].email","typeLabel":"string"},"phoneNumber":{"type":"string","maxLength":45,"uniqueKey":"data.additionalParties.items.[INDEX].phoneNumber","typeLabel":"string"},"areaNumber":{"type":"string","maxLength":5,"uniqueKey":"data.additionalParties.items.[INDEX].areaNumber","typeLabel":"string"},"roleOther":{"type":"string","maxLength":255,"description":"Description of the role when semanticRole is OTHER; exported as OpisRoli with RolaInna=1.","uniqueKey":"data.additionalParties.items.[INDEX].roleOther","typeLabel":"string"},"extraInfo":{"type":"string","maxLength":255,"uniqueKey":"data.additionalParties.items.[INDEX].extraInfo","typeLabel":"string"},"country":{"type":"string","minLength":2,"maxLength":2,"uniqueKey":"data.additionalParties.items.[INDEX].country","typeLabel":"string"},"tinCountry":{"type":"string","minLength":2,"maxLength":2,"uniqueKey":"data.additionalParties.items.[INDEX].tinCountry","typeLabel":"string"},"defaultCurrency":{"type":"string","minLength":3,"maxLength":3,"uniqueKey":"data.additionalParties.items.[INDEX].defaultCurrency","typeLabel":"string"},"partyOrder":{"type":"integer","minimum":0,"description":"Optional display order; defaults to the zero-based position in additionalParties.","uniqueKey":"data.additionalParties.items.[INDEX].partyOrder","typeLabel":"integer"},"sharePercent":{"type":"number","minimum":0,"maximum":100,"description":"Optional share percentage for the additional party.","uniqueKey":"data.additionalParties.items.[INDEX].sharePercent","typeLabel":"number"}},"uniqueKey":"data.additionalParties.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.additionalParties","typeLabel":"object[]"},"ksefWarning":{"type":"string","description":"Optional warning when immediate KSeF submission returns an unsuccessful result after the invoice was saved.","uniqueKey":"data.ksefWarning","typeLabel":"string"},"ksefErrorMessage":{"type":"string","description":"Optional KSeF failure details. The invoice identified by invoiceId is already saved.","uniqueKey":"data.ksefErrorMessage","typeLabel":"string"},"ksefReason":{"type":"string","description":"Optional machine-readable reason, for example KSEF_SUBMISSION_FAILED or KSEF_PRIVATE_PERSON_SEND_DISABLED. Treat this as an open set of values.","uniqueKey":"data.ksefReason","typeLabel":"string"},"statusId":{"type":"string","description":"Current invoice status, also available in basicInformation.statusId.","uniqueKey":"data.statusId","typeLabel":"string"},"ksefProcessing":{"type":"object","description":"Optional KSeF processing result, as in the application save response.","additionalProperties":true,"uniqueKey":"data.ksefProcessing","typeLabel":"object"}},"uniqueKey":"data","typeLabel":"Invoice · object"},"warnings":{"type":"array","description":"Optional non-blocking validation warnings.","items":{"type":"object","properties":{"field":{"type":"string","uniqueKey":"warnings.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","uniqueKey":"warnings.items.[INDEX].code","typeLabel":"string"},"message":{"type":"string","uniqueKey":"warnings.items.[INDEX].message","typeLabel":"string"},"messagePL":{"type":"string","uniqueKey":"warnings.items.[INDEX].messagePL","typeLabel":"string"}},"uniqueKey":"warnings.items.[INDEX]","typeLabel":"object"},"uniqueKey":"warnings","typeLabel":"object[]"},"result":{"type":"string","x-stoplight":{"id":"22hlosab8poxg"},"default":"OK","example":"OK","enum":["OK"],"uniqueKey":"result","typeLabel":"enum\u003cstring>"}},"uniqueKey":"","typeLabel":"SuccessResponse · object"},"examples":{"Example":{"title":"Example","value":{"result":"OK","data":{"invoiceId":12413}}}},"exampleType":"generated"}},"exampleType":"generated"},"f726ca1b-bccd-45cb-ba52-56484741b901":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","x-examples":{"Example 1":{"result":"Error","errorMessage":"This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.","errorMessagePL":"Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."}},"examples":[{"result":"Error","errorMessage":"This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.","errorMessagePL":"Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."}],"properties":{"result":{"type":"string","enum":["Error"],"default":"Error","example":"Error","uniqueKey":"result","typeLabel":"enum\u003cstring>"},"errorMessage":{"type":"string","uniqueKey":"errorMessage","typeLabel":"string"},"errorMessagePL":{"type":"string","uniqueKey":"errorMessagePL","typeLabel":"string"},"validationErrors":{"type":"array","description":"Optional field-level validation details. Use code for programmatic error handling.","items":{"type":"object","properties":{"field":{"type":"string","example":"basicInformation.issueDate","uniqueKey":"validationErrors.items.[INDEX].field","typeLabel":"string"},"message":{"type":"string","uniqueKey":"validationErrors.items.[INDEX].message","typeLabel":"string"},"code":{"type":"string","example":"DATE_REQUIRES_LOCAL_DATE","uniqueKey":"validationErrors.items.[INDEX].code","typeLabel":"string"}},"uniqueKey":"validationErrors.items.[INDEX]","typeLabel":"object"},"uniqueKey":"validationErrors","typeLabel":"object[]"},"errorCode":{"type":"string","description":"Machine-readable error code when available, including KEY_EXPIRED, NOT_FOUND or PDF_NOT_READY.","uniqueKey":"errorCode","typeLabel":"string"}},"description":"Default error message format in Altera API\nDepending on particular reason, different HTTP Status codes will be employed","uniqueKey":"","typeLabel":"object"},"examples":{"Calendar date required":{"title":"Calendar date required","value":{"result":"Error","errorMessage":"Enter a date in YYYY-MM-DD format, without a time or time zone, for example 2026-09-14.","errorMessagePL":"Podaj datę w formacie RRRR-MM-DD, bez godziny i strefy czasowej, np. 2026-09-14.","validationErrors":[{"field":"basicInformation.issueDate","message":"DATE_REQUIRES_LOCAL_DATE","code":"DATE_REQUIRES_LOCAL_DATE"}]}}},"exampleType":"examples"}},"exampleType":"examples"},"abe84ebb-4111-4a3b-a03d-04a2842b287f":{"description":"KEY_EXPIRED: a verified API key has expired. This requires that the company still has OpenAPI access. Unknown/invalid keys can receive the gateway 403.","content":{"application/json":{"schema":{"type":"object","x-examples":{"Example 1":{"result":"Error","errorMessage":"This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.","errorMessagePL":"Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."}},"examples":[{"result":"Error","errorMessage":"This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.","errorMessagePL":"Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."}],"properties":{"result":{"type":"string","enum":["Error"],"default":"Error","example":"Error","uniqueKey":"result","typeLabel":"enum\u003cstring>"},"errorMessage":{"type":"string","uniqueKey":"errorMessage","typeLabel":"string"},"errorMessagePL":{"type":"string","uniqueKey":"errorMessagePL","typeLabel":"string"},"validationErrors":{"type":"array","description":"Optional field-level validation details. Use code for programmatic error handling.","items":{"type":"object","properties":{"field":{"type":"string","example":"basicInformation.issueDate","uniqueKey":"validationErrors.items.[INDEX].field","typeLabel":"string"},"message":{"type":"string","uniqueKey":"validationErrors.items.[INDEX].message","typeLabel":"string"},"code":{"type":"string","example":"DATE_REQUIRES_LOCAL_DATE","uniqueKey":"validationErrors.items.[INDEX].code","typeLabel":"string"}},"uniqueKey":"validationErrors.items.[INDEX]","typeLabel":"object"},"uniqueKey":"validationErrors","typeLabel":"object[]"},"errorCode":{"type":"string","description":"Machine-readable error code when available, including KEY_EXPIRED, NOT_FOUND or PDF_NOT_READY.","uniqueKey":"errorCode","typeLabel":"string"}},"description":"Default error message format in Altera API\nDepending on particular reason, different HTTP Status codes will be employed","uniqueKey":"","typeLabel":"object"},"example":{"result":"Error","errorCode":"KEY_EXPIRED","errorMessage":"API key has expired"},"examples":{"Example":{"title":"Example","value":{"result":"Error","errorCode":"KEY_EXPIRED","errorMessage":"API key has expired"}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"7e698552-bf4a-4d23-bf33-7d454e0d71b2":{"Authorization":{"name":"Authorization","type":"apiKey","in":"header","description":"OpenApi Key created within Altera.app for a certain company","scopes":[],"schemeName":"Authorization"}}},"servers":{"a409ea3f-45e8-468d-8b8a-ee4ed5128e59":{"url":"https://api.altera.co","description":"Production endpoint (proxied)"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"name":"Authorization","type":"apiKey","in":"header","description":"OpenApi Key created within Altera.app for a certain company","scopes":[],"schemeName":"Authorization"},"schema":{"title":"Authorization","type":"string","description":"OpenApi Key created within Altera.app for a certain company","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Authorization","name":"Authorization"}],"title":"Authorization"}]},"originalFileLocation":"openapi/openapi.json"},"subdomain":"altera","siteName":"Altera Docs","title":"Create/update invoice - Altera Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-12T17:40:47.974Z","originalFileLocation":"openapi/sales/createupdate-invoice.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create or update a sales invoice in Altera via the OpenAPI. Set basicInformation.statusId to ISSUED to issue, or save the document as a draft.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Altera Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create/update invoice - Altera Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create or update a sales invoice in Altera via the OpenAPI. Set basicInformation.statusId to ISSUED to issue, or save the document as a draft.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Altera Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.altera.co/openapi/sales/createupdate-invoice\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://altera.mintlify.app/_mintlify/api/og/v2?division=Sales\u0026amp;title=Create%2Fupdate+invoice\u0026amp;description=Create+or+update+a+sales+invoice+in+Altera+via+the+OpenAPI.+Set+basicInformation.statusId+to+ISSUED+to+issue%2C+or+save+the+document+as+a+draft.\u0026amp;theme=febbd8a163bed7d04ebd8835\u0026amp;signature=baa66fd5d8b937bdcd69990ceef796701c817f3d05a32869271e9d72551528b7\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create/update invoice - Altera Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create or update a sales invoice in Altera via the OpenAPI. Set basicInformation.statusId to ISSUED to issue, or save the document as a draft.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://altera.mintlify.app/_mintlify/api/og/v2?division=Sales\u0026amp;title=Create%2Fupdate+invoice\u0026amp;description=Create+or+update+a+sales+invoice+in+Altera+via+the+OpenAPI.+Set+basicInformation.statusId+to+ISSUED+to+issue%2C+or+save+the+document+as+a+draft.\u0026amp;theme=febbd8a163bed7d04ebd8835\u0026amp;signature=baa66fd5d8b937bdcd69990ceef796701c817f3d05a32869271e9d72551528b7\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/altera/SK_C3OVIrtsVYanL/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Altera Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.altera.co/openapi/sales/createupdate-invoice\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/openapi/sales/createupdate-invoice.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.altera.co/#organization\",\"name\":\"Altera Docs\",\"url\":\"https://docs.altera.co\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/altera/m_Elx8565ISejHL9/logo/light.png?fit=max\u0026auto=format\u0026n=m_Elx8565ISejHL9\u0026q=85\u0026s=ff811307dfde2a632e6f62d2d1ca8613\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.altera.co#website\",\"name\":\"Altera Docs\",\"url\":\"https://docs.altera.co\",\"publisher\":{\"@id\":\"https://docs.altera.co/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.altera.co/openapi/sales/createupdate-invoice#webpage\",\"url\":\"https://docs.altera.co/openapi/sales/createupdate-invoice\",\"name\":\"Create/update invoice\",\"description\":\"Create or update a sales invoice in Altera via the OpenAPI. Set basicInformation.statusId to ISSUED to issue, or save the document as a draft.\",\"dateModified\":\"2026-10-12T17:40:47.974Z\",\"isPartOf\":{\"@id\":\"https://docs.altera.co#website\"},\"breadcrumb\":{\"@id\":\"https://docs.altera.co/openapi/sales/createupdate-invoice#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.altera.co/openapi/sales/createupdate-invoice#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Sales\",\"item\":\"https://docs.altera.co/openapi/sales/list-available-invoices\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create/update invoice\",\"item\":\"https://docs.altera.co/openapi/sales/createupdate-invoice\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.altera.co/openapi/sales/createupdate-invoice#apireference\",\"headline\":\"Create/update invoice\",\"name\":\"Create/update invoice\",\"description\":\"Create or update a sales invoice in Altera via the OpenAPI. Set basicInformation.statusId to ISSUED to issue, or save the document as a draft.\",\"url\":\"https://docs.altera.co/openapi/sales/createupdate-invoice\",\"mainEntityOfPage\":{\"@id\":\"https://docs.altera.co/openapi/sales/createupdate-invoice#webpage\"},\"dateModified\":\"2026-10-12T17:40:47.974Z\",\"publisher\":{\"@id\":\"https://docs.altera.co/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.altera.co#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Altera Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Altera Docs","nav":{"global":null,"tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/introduction"}]},{"tab":"KSEF","pages":[{"title":"KSEF","href":"/ksef/overview"}]},{"tab":"Centrum pomocy","pages":[{"title":"Centrum pomocy","href":"/faq"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/swift-settle"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/pl"}]},{"tab":"Roadmap","pages":[{"title":"Roadmap","href":"/roadmap/pl"}]},{"tab":"OpenAPI","groups":[{"group":"OpenAPI Documentation","pages":[{"title":"Altera OpenAPI Quickstart: keys, auth, first invoice","href":"/openapi/quickstart"}]},{"group":"Sales","pages":[{"openapi":"get /sales","title":"List available invoices","href":"/openapi/sales/list-available-invoices"},{"openapi":"get /sales/invoice","title":"Get invoice data","description":"Retrieve data for a particular invoice available in the system\n\nThis endpoint may be used as a base for new invoice data that we wish to create based on a set of related invoices\n\nIf you wish to generate such object base you will need to provide both:\n* `related` parameter, listing the related invoices\n* `invoiceType` of the new invoice we wish to create\n\nThe return object will be a temporary invoice object you may further extend before saving it.\n\nMissing, permanently deleted and other-company invoices return 404 NOT_FOUND with a generic message. Own soft-deleted invoices return 404 NOT_FOUND with \"Invoice has been deleted\" and no invoice data. This applies to ref and related lookups. For CORRECTION, rows come from the referenced document, without applying later corrections automatically. Reference the previous correction to use its stored after-correction state.","href":"/openapi/sales/get-invoice-data"},{"openapi":"post /sales/invoice","title":"Create/update invoice","href":"/openapi/sales/createupdate-invoice"},{"openapi":"post /sales/markPaid","title":"Mark Invoice as paid","description":"Sets the payment status of selected invoices as paid, marks paidAmount as whole amount.","href":"/openapi/sales/mark-invoice-as-paid"},{"openapi":"post /sales/markUnpaid","title":"Mark Invoice as unpaid","href":"/openapi/sales/mark-invoice-as-unpaid"},{"openapi":"post /sales/pdfUrl","title":"Generate PDF url","href":"/openapi/sales/generate-pdf-url"},{"openapi":"post /sales/invoice/send","title":"Send invoice email to contractor","href":"/openapi/sales/send-invoice-email-to-contractor"},{"title":"Delete a sales invoice","deprecated":null,"version":null,"openapi":"/openapi/openapi.json post /sales/delete","href":"/openapi/sales/delete-a-sales-invoice"}]},{"group":"Data export","pages":[{"openapi":"get /export","title":"Export invoice information","href":"/openapi/data-export/export-invoice-information"}]},{"group":"Expenses","pages":[{"openapi":"get /expenses","title":"List available expenses","href":"/openapi/expenses/list-available-expenses"},{"openapi":"post /expenses/generate","title":"Generate new expense reference","href":"/openapi/expenses/generate-new-expense-reference"}]},{"group":"Configuration","pages":[{"openapi":"post /company/contractors","title":"Add/modify contractor","href":"/openapi/configuration/addmodify-contractor"},{"openapi":"post /company/products/categories","title":"Add/modify products' category","href":"/openapi/configuration/addmodify-products-category"},{"openapi":"post /company/products","title":"Add/modify a product","href":"/openapi/configuration/addmodify-a-product"},{"openapi":"get /company/projects","title":"List projects","href":"/openapi/configuration/list-projects"},{"openapi":"post /company/projects","title":"Add/modify a project","href":"/openapi/configuration/addmodify-a-project"}]}]}]},"basePath":"","title":"Create/update invoice - Altera Docs","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CS552b7R.js","utils-DDTCYAF2.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-De8ttokP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DrwRDvAh.js","snippetPresets-DtAN0nWx.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-D5rWArI6.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-O2i12wsz.js","shallow-DV8xABTt.js","getApiPlaygroundDisplay-DBZ0B5Jx.js","CodeSnippet-BVi0tPUX.js","CodeSnippets-CqASbIwY.js","Page-m07pfKpT.js","getPastedJson-DG9vsMS8.js","icon-CXzRSCr8.js","MethodPill-BdKVtEuX.js","DuplicateIcon-CZlmBrJI.js","createIcon-biFEUKPL.js","DynamicMarkdown-B54_zNBF.js","SectionHeading-DwwHK3Pt.js","axios-vUo_bRtp.js","Markdown-DfhCTwyA.js","clsx-xpJZXxdP.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BTZUMDnx.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-DqdKa2R4.js"]}