Hello. Thank you for contacting the Toolset support.
You wrote:
I have a one to one relationship between post a and post b. I have an id for post a and I want to retrieve the related post. Looking at the api docs, for toolset_get_related_post my api call should look like
toolset_get_related_posts(post_id_a,relationship_slug, {parent || child})
==>
But the function should be used is: toolset_get_related_post()
Now, later you said, that you are using the function: toolset_get_related_post():
toolset_get_related_post( $book_id, array( 'writer', 'book' ) );
but you should adjust the relationship array array( 'writer', 'book' ) to your post-relationship slug.
So, if you pass the child ID and without specifying the third argument parent/child, the default is parent, for example:
$child_id = 999;
$parent_id = toolset_get_related_post($child_id,'cpt-promoter-artist');
The above function will return the parent ID.
To get the child ID, you will require to pass the parent ID.
$parent_id = 222;
$child_id = toolset_get_related_post($parent_id,'cpt-promoter-artist','child');
The above example will return the child ID.
In your case, as per the screenshot you shared:
- https://toolset.com/wp-content/uploads/2021/02/1938641-Edit_Specials_Angebote_Relationships_hunde_urlaub_net_WordPress.png
You should consider the Specials post type as parent and Special Angebote will be the child post type.