If you change the document type on a document, a different document series usually belongs to it. Whether the internal number is regenerated depends on what you send along with the type.
When the number is regenerated
What you send | Result |
Only the new | The internal number is regenerated according to the new type's series. |
| Your code is used, the number is not regenerated. |
| The change reaction is triggered and the number is regenerated according to the series — the submitted |
So, if you want to be sure that the document receives a number from the new type's series, send the previous value:
{
"winstrom": {
"faktura-vydana": {
"id": "20",
"typDokl": "code:FAKTURA",
"typDokl@previousValue": "code:ZÁLOHA"
}
}
}
ℹ️ The previousValue attribute triggers the change reaction — the same logic that runs when you make a manual change in the application. It works the same way for the exchange rate, price, or company link; the principle is described in the article Updating amounts when the exchange rate changes.
⚠️ The document type changes together with the document series, so the numbering changes as well. If you have the document number linked in another system, keep in mind that it will differ after this operation.
