It is not possible to create a credit note with an invoice link in a single step.
You must first create the credit note and then link it to the invoice — see https://www.flexibee.eu/api/dokumentace/ref/dobropisy.
A second option would be to use transactional processing:
https://www.flexibee.eu/api/dokumentace/ref/tx/
