Applying Credit to an Invoice
You will need the QuickBooks Credit Note and Invoice IDs to link the two together.
To achieve this, you need to create a zero-dollar payment, which is the link between the Credit Memo and the Invoice. The Credit Memo is linked to the zero-dollar payment, which is then linked to the Invoice.
Do you want to know list of supported parameters for a Payment? See here.