Skip to content
HALOWERK

Formatwerk

credit note generate

Reads the original XRechnung (UBL or CII), takes all lines or the selected line ids with optional reduced quantities, and generates a credit note (381) or corrected invoice (384) with the original invoice number as preceding invoice reference (BT-25), the same parties and payment data, a new number and issue date. Amounts stay positive as required by EN 16931 for credit notes; the result is validated with the KoSIT validator before it is returned.

POST https://format.halowerk.com/v1/credit-note-generate

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
xmlstringYes
numberstringYes
issue_datestringYes
type_codestringNo
syntaxstringNo
linesarrayNo
notestringNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "xml",
    "number",
    "issue_date"
  ],
  "properties": {
    "xml": {
      "type": "string",
      "minLength": 50,
      "maxLength": 5000000
    },
    "number": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "issue_date": {
      "type": "string",
      "format": "date"
    },
    "type_code": {
      "type": "string",
      "enum": [
        "381",
        "384"
      ],
      "default": "381"
    },
    "syntax": {
      "type": "string",
      "enum": [
        "same",
        "ubl",
        "cii"
      ],
      "default": "same"
    },
    "lines": {
      "type": "array",
      "maxItems": 1000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        }
      }
    },
    "note": {
      "type": "string",
      "maxLength": 2000
    }
  }
}

Open original schema

Published input example

{
  "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\">…</Invoice>",
  "number": "GS-2026-0001",
  "issue_date": "2026-11-02",
  "lines": [
    {
      "id": "1",
      "quantity": 1
    }
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →