Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Get Opportunities of Contact using API

(1) ShareShare
ReportReport
Posted on by 2
Hi, I want to fetch a contact's opportunity id using APIs. Is there any way I can get opportunity id if I have the contact id? 
I need to update the opportunity but I only have the contact id. So if I can get the opportunity Id I can update the opportunity. 
If there is a way kindly let me know what endpoint should I use and hit to get the opportunity Id?
 
 
I am using a 3rd party tool to make requests. My end goal is to update the opportunity when I update a contact.
So at the moment of contact update I won't have the opportunity ID, to get that I would need make another request to get all opportunity IDs of that contact and then update them. I would prefer to use the api's listed in documentation. Is it possible in any of those APIs?
  • SeGra Profile Picture
    44 on at
    Get Opportunities of Contact using API
    Hi,
     
    if you have the contact id, you should also have the contact no. or get this value easily.
     
    You can then filter the get command of opportunities by leaving out the opportunity id and providing the Filter Parameter like this:
     
    GET https://{businesscentralPrefix}/api/v2.0/companies({id})/opportunities?$filter=contactNumber eq 'CT200116'

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,996 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans