I believe the REST API’s Order Payment method should allow a negative value to issue a refund, although I haven’t tested it personally. Keap REST API
It looks like the method you have cited there is probably calling this XMLRPC one: xml-rpc - Keap Developer Portal, and for that you would be using the Invoice ID.