Adding values to referential entity using REST API POST
You can see the article about create Custom Rest Resources for POST 

You can reference below code below

$node_actor = Node::create(
      ['type' =&gt; 'actor',// the content type
        'title' =&gt; 'Actor Name',
      ]
    );
   $actor_id = $node_actor-&gt;save();


After you can use $actor_id had node reference to movie

$node_movie = Node::create(
   ['type' =&gt; 'movie',// the content type
    'title' =&gt; 'Movie Name',
   ]
  );
  $node_movie-&gt;set('field_actor_ref',['target_id'=&gt;$actor_id])
  $node_movie-&gt;save();