JSON encode POST data. Better setting of mode. Ensure partner ID is an int