If you have the entity in your domain model already, you could use message definition. Use the export mapping to generate your JSON. Reference post : https://forum.mendix.com/link/questions/109344
See also this post:
https://forum.mendix.com/link/questions/99225
Hope this helps
To generate a json representation of your entitiy using the following steps:
1 – Define the required JSON format in a JSON structure document
2 – Define how your entity should be mapped to the JSON definition with a Export Mapping
3 – Generate the JSON in a Microflow using the Export with Mapping activity