API Error in v12 when posting invoice

A similar report here TypeError: the JSON object must be str, bytes or bytearray, not 'dict' - #2 by rmeyer

This howto may help you to debug the problem Debugging in ERPNext - #3 by nabinhait