Sage API 3.1 and Refunds

Hi

I'm working on a solution using the Sage 3.1 APi and all is going well but I have a scenario which is causing a few issues.

The customer makes a card payment which is added to Sage (via API) before the invoice is generated and before the goods are despatched.

The order changes e.g. 2 items required instead of 3) and a refund is paid back to the customer by card.

the order is dispatched and an invoice is generated allocating the payment to the invoice (all via API) .

What is the correct procedure of issuing a refund payment back to the customer to cover the reduced number of items so it shows correctly in Sage?

Create a Credit note then a refund payment both in Sage via API?