how to pass object as body of a post request in json format

Solution for how to pass object as body of a post request in json format
is Given Below:

I am writing an API that create some terminals. I want to make a post request from postman with a JSON body but it gives me error. I have searched about how to pass a object and tried the solutions. I don’t know I am making post request with bad format or there is a problem in somewhere in my code. so, I would be very appreciated if anyone could help me.

I have a Terminal (terminal is somehow a device) class which is as follows:

@Table(name = "Terminals")
public class Terminal {

    private long terminalID;

    @Column(name = "serialNumber")
    private String serialNumber;

    @ManyToOne(fetch = FetchType.LAZY)
    private Model model;

    @Column(name = "operatingSys")
    private String operatingSys;

    @Column(name = "brand")
    private String brand;

    @Column(name = "location")
    private String location;

    @Column(name = "version")
    private String version;

    public Terminal() {


    public Terminal(long terminalID, String serialNumber, Model model,
                String operatingSys, String brand, String location,
                String version) {
        this.terminalID = terminalID;
        this.serialNumber = serialNumber;
        this.model = model;
        this.operatingSys = operatingSys;
        this.brand = brand;
        this.location = location;
        this.version = version;

as it is clear from the code, I have a Model class that Terminal has a many-to-one relation with Model class. and also my model class has one-to-many relation with the terminal class.
and the Model class is as follows:

@Table(name = "model")
public class Model {

    private String modelID;

            mappedBy = "model",
            cascade = CascadeType.ALL,
            orphanRemoval = true
    private List<Terminal> terminals = new ArrayList<>();

    @Column(name = "newVersion")
    private String newVersion;

    @Column(name = "newVersionDlUrl")
    private String newVersionDlUrl;

    public Model() {

    public Model(String modelID, String newVersion, String newVersionDlUrl) {
        this.modelID = modelID;
        this.newVersion = newVersion;
        this.newVersionDlUrl = newVersionDlUrl;

    public void addTerminal(Terminal terminal) {

    public void removeTerminal(Terminal terminal) {

also this is my API for creating a Terminal:

    public ResponseEntity<Terminal> createTerminal(@RequestBody Terminal terminal) {
        try {
            Terminal _terminal = terminalRepository
                    .save(new Terminal(terminal.getTerminalID(),terminal.getSerialNumber(),

            return new ResponseEntity<>(_terminal, HttpStatus.CREATED);
        } catch (Exception e) {
            return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);

also this is the way I make post request for creating terminals:

    "terminalID": "456789",
    "serialNumber": "a5487",
    "model": {
    "modelID": "galaxy"
    "operatingSys": "android",
    "brand": "samsung",
    "location": "amsterdam",
    "version": "1.1.2"

by this request I get Internal Server Error.

"message": "Type definition error: [simple type, class 
org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor]; nested exception is 
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class 
org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create 
BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through 
reference chain: com.mypackage.models.Terminal["model"]- 

If anyone could help I would be very appreciated.