Hi Team,
I would like to understand how we can call a custom API (of type API Page) in Business Central without including the Company ID in the URL. Currently, we have created a custom API to create a Sales Order in Business Central from a third-party system. As per the standard format, we are required to mention the Company ID in the URL.
However, we want this API to work dynamically, so we don't have to hardcode or pass the Company ID manually in the API call.
For example, we are using the standard Companies API to retrieve the list of companies. In our setup, we want to maintain a Boolean field—if this Boolean is set to true for a particular company, then only that company should be allowed to create a Sales Order via the custom API from our .NET platform.
Is there any recommended approach or alternative to achieve this dynamic company selection without hardcode or pass the Company ID manually in the API call?
Thanks & Regards,