I’d have to look at the code to give you real answers.
What you want to do is have your plugin add that custom field to the serializer. You can search some existing plugins for add_to_serializer in plugin.rb for some examples. Then you can wrangle that into the badge on the front end.