Hi @ideiamais
Isn’t the Accounts-Opportunities a many to many relationship, right?
Or do you have any custom changes to the relationship? 
Relationship definition from metadata/accounts_opportunitiesMetaData.php
$dictionary['accounts_opportunities'] = array(
'table' => 'accounts_opportunities',
'fields' => [........],
'indices' => [.........],
'relationships' =>
array(
'accounts_opportunities' =>
array(
'lhs_module' => 'Accounts',
'lhs_table' => 'accounts',
'lhs_key' => 'id',
'rhs_module' => 'Opportunities',
'rhs_table' => 'opportunities',
'rhs_key' => 'id',
'relationship_type' => 'many-to-many',
'join_table' => 'accounts_opportunities',
'join_key_lhs' => 'account_id',
'join_key_rhs' => 'opportunity_id',
),
),
);
For many to many relationships you need to call the set_relationship from the V4 API.
V4 API set_relationship details from /service/v4_1/rest.php
/**
* Set a single relationship between two beans. The items are related by module name and id.
*
* @param String $session -- Session ID returned by a previous call to login.
* @param String $module_name -- name of the module that the primary record is from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method)..
* @param String $module_id - The ID of the bean in the specified module_name
* @param String link_field_name -- name of the link field which relates to the other module for which the relationship needs to be generated.
* @param array related_ids -- array of related record ids for which relationships needs to be generated
* @param array $name_value_list -- The keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have.
* @param integer $delete -- Optional, if the value 0 or nothing is passed then it will add the relationship for related_ids and if 1 is passed, it will delete this relationship for related_ids
* @return Array - created - integer - How many relationships has been created
* - failed - integer - How many relationsip creation failed
* - deleted - integer - How many relationships were deleted
* @exception 'SoapFault' -- The SOAP error, if any
*/
Method [ public method set_relationship ] {
- Parameters [7] {
Parameter #0 [ $session ]
Parameter #1 [ $module_name ]
Parameter #2 [ $module_id ]
Parameter #3 [ $link_field_name ]
Parameter #4 [ $related_ids ]
Parameter #5 [ $name_value_list ]
Parameter #6 [ $delete ]
}
}
So, to add the relationship, you need to do something like:
$parameters = [
'session' => $session_id,
'module_name' => 'Accounts',
'module_id' => $account_id,
'link_field_name' => 'opportunities',
'relate_ids' => [$idOportunities],
'name_value_list' => [],
'delete' => 0
];
$set_entry_result_account = call("set_relationship", $parameters, $url);
Hope this helps solve the issue.