Business Central Webhooks with API: Setup, Use Cases, and Code Examples

Introduction

Microsoft Dynamics 365 Business Central webhooks help external applications receive real-time notifications when selected records are created, updated, or deleted.

Instead of repeatedly calling the Business Central API to check for changes, your application can subscribe to specific resources and react when an event happens.

This is useful for ERP, CRM, eCommerce, finance, inventory, reporting, and order management integrations where delayed updates can create operational gaps.

In this guide, we will cover how Business Central webhooks work with APIs, where they are useful, how to create a webhook subscription, how to validate incoming notifications, and what developers should consider before using webhooks in production.

Microsoft Business Central API with webhooks integration overview showing use cases and code snippets

Understanding Business Central Webhooks

What Are Business Central Webhooks?

Webhooks are HTTP-based callbacks that notify another application when a specific event occurs.

In Business Central, webhooks allow an external application to subscribe to changes in supported resources, such as customers, vendors, items, sales orders, invoices, or other business records.

For example, when a new sales order is created in Business Central, a webhook can notify an external order management system, CRM, reporting tool, or middleware application.

The receiving system can then fetch the updated record using the Business Central API and continue the required workflow.

Diagram showing how webhooks work with HTTP callbacks for real-time data transfer between applications

Webhooks function via an authentication procedure, using payloads and HTTP protocols to transfer data to help explain the technical details. (Working with Webhooks in Dynamics 365 Business Central (v1.0), 2024)

By ensuring that appropriate information is given on time when needed, this method promotes a system that is more responsive and dynamic.

Why Are Webhooks Important for Business Central Integrations?

Webhooks reduce the need for constant API polling. Instead of checking Business Central again and again for updates, your application receives notifications when relevant changes happen.

This helps businesses keep connected systems updated faster, reduce unnecessary API calls, and trigger workflows based on real-time business events.

How to Validate Business Central Webhook Notifications

Webhook validation is important because your endpoint should not process every incoming request blindly.

Before processing a notification, verify that it belongs to your Business Central subscription and was sent to the correct endpoint.

Validation AreaWhat to Check
Notification URL validationMake sure your endpoint responds correctly during subscription setup
Client stateMatch the received client state with the value stored during subscription creation
Subscription IDConfirm that the notification belongs to an active subscription
HTTPS endpointUse a secure public endpoint
Response statusReturn the correct status code after receiving the notification
LoggingStore request details for debugging and audit purposes

In production, validation should be combined with logging, retry handling, and idempotency.

This helps avoid duplicate processing if the same event is received more than once.

How to Process Business Central Webhook Payloads

A Business Central webhook notification usually tells your application that a change happened.

In many cases, the notification itself may not contain the full business record. Your application should use the Business Central API to fetch the complete data before updating another system.

Recommended Processing Flow

  1. Receive the webhook notification.
  2. Validate the notification.
  3. Identify the changed resource.
  4. Fetch the latest record using Business Central API.
  5. Transform the data if needed.
  6. Send the data to the connected system.
  7. Log the event status.
  8. Retry failed operations where required.

For example, if a sales invoice is updated in Business Central, the webhook can trigger your integration layer.

The integration layer can then fetch the updated invoice details and send them to an accounting dashboard, CRM, or reporting platform.

How to Renew Business Central Webhook Subscriptions

Business Central webhook subscriptions should be monitored and renewed before they expire. If a subscription expires, your application will stop receiving notifications for that resource.

A good practice is to store the subscription ID, resource, notification URL, client state, and expiration time in your database. You can then run a scheduled job to renew active subscriptions before expiration.

Best PracticeWhy It Matters
Store expiration timeHelps renew subscriptions before they expire
Use a scheduled background jobAvoids missed webhook events
Log renewal attemptsHelps identify failed renewals
Alert on renewal failurePrevents silent integration breaks
Remove unused subscriptionsKeeps the integration clean

Overview of Microsoft Dynamics 365 Business Central API

The Microsoft Dynamics 365 Business Central API allows external systems to interact with Business Central data such as customers, vendors, items, sales orders, purchase orders, invoices, payments, and financial records.

In a webhook-based integration, the API usually handles the actual data operation, while the webhook acts as the trigger. For example, a webhook can notify your application that a customer record has changed, and the API can then retrieve the updated customer details.

Integration Capabilities of Business Central APIs

Business Central webhook event processing workflow showing API integration, middleware automation, CRM, and reporting sync.

A Business Central webhook integration usually follows this flow:

  1. The external application creates a webhook subscription in Business Central.
  2. Business Central validates the notification URL.
  3. When the subscribed resource changes, Business Central sends a notification to the external endpoint.
  4. The external application validates the notification.
  5. The application uses the Business Central API to fetch the latest record details.
  6. The application updates the connected system, such as CRM, eCommerce, reporting, accounting, or middleware.

For broader ERP connectivity requirements, Satva also provides Microsoft Dynamics integration services covering Dynamics 365 Business Central, Finance & Operations, and other Microsoft ERP environments.

Business Central Webhooks vs API Polling

Business Central APIs and webhooks are often used together, but they solve different problems.

APIs are used to read, create, update, or delete data. Webhooks are used to notify an external system when something changes.

API PollingBusiness Central Webhooks
The external system checks Business Central at fixed intervalsBusiness Central notifies the external system when an event occurs
Better for scheduled batch syncBetter for event-based updates
Can increase API usageHelps reduce unnecessary API calls
May create delays depending on polling frequencyUseful for near real-time workflows
Suitable for full data reconciliationSuitable for triggering follow-up actions

In many real-world integrations, both are used together. Webhooks notify the external system that something has changed, and the Business Central API is then used to fetch the full record details.

How Business Central Webhooks Work with APIs

How Webhooks Trigger API-Based Workflows

Webhooks and the MS Business Central API function as a cohesive unit. Consider them as friends who support one another.

Webhooks provide real-time communication, which enhances the functionality of the MS Business Central API.

It’s similar to receiving brief messages and updates, allowing firms to be aware of developments immediately.

Benefits of Real-Time Business Central Webhook Integration

Examine the observable advantages of real-time communication made possible by the integration of webhooks and the Dynamics 365 Business Central API.

Businesses are using this synergy to stay ahead in the competitive landscape by being more responsive and agile.

How to Create a Business Central Webhook Subscription

To receive webhook notifications from Business Central, your external application needs to create a subscription.

The subscription defines which resource you want to monitor and where Business Central should send notifications.

A typical webhook subscription includes:

  • notificationUrl: The public endpoint where Business Central will send notifications
  • resource: The Business Central entity or API resource you want to monitor
  • clientState: A value used to verify that the notification belongs to your application
  • expirationDateTime: The time until which the subscription remains active

For example, if your application wants to track customer changes, it can subscribe to the customer resource.

When a customer is created, updated, or deleted, Business Central sends a notification to your endpoint.

Your application can then call the Business Central API to retrieve the latest customer information.

In some projects, the standard Business Central API may not expose the exact table, field, or data structure required for the webhook workflow.

In that case, developers can create custom Business Central API endpoints using AL.

Best Business Central Webhook Use Cases

Webhooks for the Microsoft Dynamics 365 Business Central API provide a strong means of integrating Business Central with different applications and services.

Here are some use cases where these webhooks can be highly beneficial:

Use CaseWebhook TriggerConnected SystemBusiness Benefit
Real-time inventory updatesItem or inventory changeWarehouse, eCommerce, POSKeeps stock data updated across systems
Automated order processingNew sales orderCRM, eCommerce, fulfillment appStarts order processing faster
Invoice syncInvoice created or updatedAccounting software, reporting toolKeeps finance records current
Customer data syncCustomer created or updatedCRM, support platformKeeps customer records consistent
Purchase order alertsPurchase order updatedSupplier portal, procurement systemImproves purchase visibility
BI reporting updatesFinancial or operational record updatedBI dashboardGives teams fresher reporting data
HR/payroll syncEmployee record updatedPayroll or HRMSReduces manual employee data updates

If your webhook workflow is focused on invoices, payouts, reconciliation, or accounting records, Satva’s accounting automation solutions can help reduce manual finance work across platforms like QuickBooks, Xero, Sage, NetSuite, Business Central, MYOB, and more.

Which Business Central Entities Can Be Used with Webhooks?

Business Central webhooks can be used with supported API resources depending on the version and endpoint being used.

Common webhook-related resources include business records such as customers, vendors, items, employees, sales documents, purchase documents, journals, and financial data.

EntityExample Webhook Use Case
CustomersUpdate CRM when customer details change
VendorsSync vendor updates with procurement systems
ItemsPush product or inventory changes to eCommerce
Sales OrdersTrigger fulfillment or shipping workflow
Sales InvoicesUpdate finance dashboards or accounting systems
Purchase InvoicesNotify approval or payment workflows
EmployeesUpdate HR or payroll systems
JournalsTrigger financial reporting updates
Note: Always verify the supported resource and API version before creating a production webhook subscription.

Common Business Central Webhook Issues and Fixes

IssuePossible ReasonRecommended Fix
Webhook subscription is not createdNotification URL did not respond correctlyCheck endpoint availability and validation response
Notifications are not receivedEndpoint is down or inaccessibleUse HTTPS and monitor endpoint uptime
Duplicate notifications are processedEvent is handled more than onceAdd idempotency checks
Subscription expiredRenewal was not scheduledStore expiration time and renew before expiry
Payload does not include full dataNotification only signals a changeFetch full record using Business Central API
Connected system receives outdated dataAPI fetch happens before record update is fully availableAdd retry or delay logic where needed
Debugging is difficultLogs are missingLog subscription ID, resource, timestamp, and processing status

For complex webhook failures, sync gaps, or multi-system ERP workflows, working with Business Central integration experts can help you identify the right API structure, retry logic, validation process, and monitoring setup.

Step-by-Step Guide to Integrate Business Central Webhooks

Integrating webhooks into Microsoft Dynamics 365 Business Central involves a series of steps to set up and handle events.

Webhooks allow you to receive real-time notifications when certain events occur in your Business Central instance.

Below is a step-by-step guide with code snippets to help you seamlessly integrate webhooks into the Microsoft Dynamics 365 Business Central API.

Step 1: Create a Webhook Subscription

Code snippet showing how to set up a webhook subscription in Microsoft Business Central

Step 2: Receive Webhook Notifications

Configure a server endpoint to receive and process incoming webhook alerts.

Verify that the requests are coming from Business Central by making sure to authenticate them.

Screenshot of a C# code snippet showing a function that handles webhook requests from the Business Central API. The function validates the request, processes the payload if valid, and responds with appropriate status codes.

Step 3: Validate the Incoming Request

Create a function that verifies incoming webhook requests to make sure the signature is legitimate and that they originate from Business Central.

Code snippet for a function named "ValidateWebhookRequest" using MS Business Central API with sections to implement validation logic and verify request headers, payload, and signature, returning a boolean result.

Step 4: Fetch and Process Updated Business Central Data

Put the logic in place to handle the webhook payload that Business Central sent you. Collect the necessary information and take the appropriate action.

C# code snippet showing ProcessWebhookPayload method for extracting event data from Business Central API: The code snippet defines a private void method, `ProcessWebhookPayload`, utilizing the MS Business Central API. It includes comments explaining how to extract the event type and entity ID from a payload for updating the database efficiently.

Step 5: Renew or Delete the Subscription

Implement a mechanism to unsubscribe from webhooks when they are no longer needed or if there’s an error.

C# code snippet demonstrating how to unsubscribe from a Business Central webhook using DeleteWebhookSubscription: This code snippet demonstrates how to unsubscribe from a webhook using the MS Business Central API with the "BusinessCentralClient.DeleteWebhookSubscription(subscriptionId);" command.
Note: Ensure you have appropriate error handling, security measures, and logging in place for a production environment.

This is a basic guide to get you started with integrating webhooks into Microsoft Dynamics 365 Business Central.

Adjust the code snippets according to your specific requirements and follow best practices for security and error handling.

FAQs

1. What are Business Central webhooks?

Business Central webhooks are event-based notifications that alert an external application when a supported record is created, updated, or deleted in Microsoft Dynamics 365 Business Central. They help external systems react to changes without repeatedly calling the Business Central API.

2. How do Business Central webhooks work with APIs?

Business Central webhooks notify your application when a change happens in a subscribed resource. After receiving the notification, your application can use the Business Central API to fetch the latest record details and update another system such as CRM, eCommerce, accounting, reporting, or middleware.

3. How do I create a webhook subscription in Business Central?

To create a Business Central webhook subscription, your application needs to define the resource to monitor, provide a public notification URL, add a client state value for validation, and send the subscription request through the Business Central API. Once the subscription is created, Business Central sends notifications to the configured endpoint when the selected resource changes.

4. What is webhook validation in Business Central?

Webhook validation in Business Central confirms that the notification URL is reachable and that incoming notifications belong to the correct subscription. During implementation, developers should validate the client state, subscription ID, endpoint response, and request details before processing any webhook event.

5. What data is included in a Business Central webhook payload?

A Business Central webhook payload usually tells your application that a change has occurred for a subscribed resource. In many cases, it may not include the complete business record. The recommended approach is to validate the notification first and then call the Business Central API to fetch the full updated data.

6. Do Business Central webhook subscriptions expire?

Yes, Business Central webhook subscriptions can expire and should be renewed before the expiration time. Developers should store subscription details such as subscription ID, resource, notification URL, client state, and expiration time, then use a scheduled job to renew active subscriptions.

7. What are common use cases of Business Central webhooks?

Common Business Central webhook use cases include real-time inventory updates, sales order notifications, invoice sync, customer data updates, vendor updates, purchase order alerts, financial reporting updates, and CRM or eCommerce integration workflows.

8. Why is my Business Central webhook not receiving notifications?

A Business Central webhook may not receive notifications if the notification URL is not publicly accessible, the validation response is incorrect, the subscription has expired, the endpoint is down, or the resource path is not configured properly. Logging subscription IDs, response status codes, and webhook events can help identify the issue faster.

Conclusion

In conclusion, companies looking to improve their operations have a multitude of options.

Thanks to the combination of webhooks and the MS Business Central API.

The combination of webhooks with the MS Business Central API inspires innovation in:

  • Inventory management
  • Process automation
  • Financial reporting

Firms that embrace this exciting combination will surely change how they function, interact, and prosper in the information age as they negotiate the details of contemporary operations.

If you have a Microsoft Dynamics 365 Business Central API Integration requirement you would like to discuss, or would like to know more about our Business Central Integration services, please get in touch with us.




Article by

Jignasha Rathod

Jignasha Rathod is a Technical Analyst with over a decade of experience in the IT industry. She excels in .NET, CI/CD, GitHub, Azure. and has a proven track record in project management, leadership, API integrations, and Azure AI and ML.net . Jignasha is focused on performance enhancement and possesses deep domain expertise in open source CMS ( umbraco, orchard cms ) accounting, CRM, ERP (SAP, NetSuite, Business Central) and e-commerce. Her extensive experience spans across both B2B and B2C e-commerce platforms, and she is leveraging AI and ML technologies to drive innovation and efficiency in client projects.