Business Central is a business management solution for small and mid-sized organizations that automates and streamlines business processes and helps you manage your business. Business Central enables companies to manage their business, including finance, manufacturing, sales, shipping, project management, services, and more. Companies can easily add functionality that is relevant to the region of operation, and that is customized to support even highly specialized industries.
Note: You must use an HTTPS connector to connect to Microsoft Dynamics 365 Business Central with OData.
This article leads you through prerequisites for creating imports and exports using Business Central's OData web services.
Additional references: Set up a connection to Microsoft Dynamics 365 Business Central, Handlebars helper reference
Prior to importing and exporting data, you must enable APIs in Microsoft Dynamics Business Central and Create an iClient (application) in Microsoft Dynamics 365 Business Central. Your Client ID is available In your Microsoft - App registrations. Don't forget to write down the Tenant ID, Client ID, and Client Secret.
To authenticate Microsoft Dynamics Business Central via OData APIs, follow these steps:
- Create a new HTTPS connection.
- Enter the Base URI: https://api.businesscentral.dynamics.com/v2.0
- Enter the iClient information.
- Enter the Auth URI: https://login.windows.net/[Tenant_ID]/oauth2/authorize?resource=https://api.businesscentral.dynamics.com
- Enter the Access Token URI: https://login.microsoftonline.com/common/oauth2/token
Below is an example export using the 'Get Invoices' operation.
Below is an example import using the 'Post Invoices' operation.
The relative URI is: /[Your_Tenant_Id]/[Your_Environment_Name]/ODataV4/MWISalesPosting_PostInvoice?Company=[Your_Company_Name]
Below is an example import using the 'Create Sales Order Lines' operation (one import that creates multiple lines).
The relative URI is: /[Your_Tenant_Id]/[Your_Environment_Name]/ODataV4/salesDocumentLines?Company=[Your_Company_Name]
The example HTTP request body is as follows: