---
title: "Developer guide to fetch expense data from Microsoft Dynamics Business Central API"
url: "http://35.223.47.52/blog/developer-guide-to-fetch-expense-data-from-microsoft-dynamics-business-central-api/"
date: "2026-08-13T12:58:41+00:00"
modified: "2026-08-23T11:20:41+00:00"
type: "post"
---

# Developer guide to fetch expense data from Microsoft Dynamics Business Central API

[Blog](http://35.223.47.52/blog) / [Tutorials](http://35.223.47.52/blogs/tutorials/) / Developer guide to fetch expense data from Microsoft Dynamics Business Central API [Tutorials](http://35.223.47.52/blogs/tutorials/) · August 13, 2026 

Developer guide to fetch expense data from Microsoft Dynamics Business Central API
==================================================================================

 ![](https://storage.googleapis.com/knit-website-media/2026/08/64c34ca1e0546a9d333bb35a_Kunal-3-150x150.png)Kunal Mishra

3 min read

 

 

 [](https://www.linkedin.com/sharing/share-offsite/?url=http%3A%2F%2F35.223.47.52%2Fblog%2Fdeveloper-guide-to-fetch-expense-data-from-microsoft-dynamics-business-central-api%2F) [](https://twitter.com/intent/tweet?url=http%3A%2F%2F35.223.47.52%2Fblog%2Fdeveloper-guide-to-fetch-expense-data-from-microsoft-dynamics-business-central-api%2F&text=Developer%20guide%20to%20fetch%20expense%20data%20from%20Microsoft%20Dynamics%20Business%20Central%20API)  

 

 

 

  Table of Contents - [Introduction](#introduction)
- [Get Expense Data from Microsoft Dynamics Business Central API](#get-expense-data-from-microsoft-dynamics-business-central-api)
- [Prerequisites](#prerequisites)
- [API Endpoint](#api-endpoint)
- [Step-by-Step Process](#step-by-step-process)
- [Common Pitfalls](#common-pitfalls)
- [Frequently Asked Questions](#frequently-asked-questions)
- [Knit for Microsoft Dynamics Business Central API Integration](#knit-for-microsoft-dynamics-business-central-api-integration)
 
  Introduction
------------

This article is part of a deep-dive series on the **Microsoft Dynamics Business Central API**. The focus here is narrow and practical: pulling expense data from Business Central using its API.

If you’re looking for broader coverage, authentication models, rate limits, pagination patterns, or other supported use cases, refer to the complete Microsoft Dynamics Business Central API guide [here](/blog/microsoft-business-central-api-guide-in-depth/).

Get Expense Data from Microsoft Dynamics Business Central API
-------------------------------------------------------------

### Prerequisites

Before you touch code, get the basics right. Most failures happen here.

- API access must be enabled in your Business Central environment. This requires configuration via the Business Central Administration Shell and enabling OData and API services.
- You must have valid authentication credentials: a username and a web service access key.
- You should be familiar with Microsoft’s API terms of use to avoid compliance or access issues later.

### API Endpoint

All requests are routed through the Business Central OData v4 endpoint:

`https://api.businesscentral.dynamics.com/v2.0/{tenant_id}/sandbox/ODataV4/<br></br>`

The `{tenant_id}` and environment (`sandbox` vs `production`) must match your setup exactly. One mismatch and you’ll get hard failures.

### Step-by-Step Process

#### 1. Authentication

Business Central uses **Basic Authentication** with:

- Username
- Web service access key (used as the password)

This is straightforward but unforgiving—invalid credentials return immediate 401 errors.

#### 2. Fetch Expense Data

Expense data may not always live under a single logical entity, so you may need to query multiple endpoints depending on how expenses are modeled in your tenant.

```
import requests
from requests.auth import HTTPBasicAuth

# Define your credentials
username = 'your_username'
password = 'your_web_service_access_key'

# Define the endpoint
url = 'https://api.businesscentral.dynamics.com/v2.0/{tenant_id}/sandbox/ODataV4/Expenses'

# Make the request
response = requests.get(url, auth=HTTPBasicAuth(username, password))

# Check the response
if response.status_code == 200:
    expenses = response.json()
    print(expenses)
else:
    print('Failed to retrieve data:', response.status_code)
```

Common Pitfalls
---------------

These issues come up repeatedly in real-world implementations:

1. API access not enabled in the Business Central environment.
2. Incorrect tenant ID or malformed endpoint URLs.
3. Invalid username or web service access key.
4. No handling for API rate limits or throttling.
5. Breaking changes due to ignored API version updates.
6. SSL verification disabled or misconfigured.
7. Insufficient permissions on the underlying data entities.

Bottom line: most “API issues” are configuration or governance problems, not code problems.

Frequently Asked Questions
--------------------------

**How do I enable API access?**
Use the Business Central Administration Shell to enable OData and API services.

**What authentication method does Business Central use?**
Basic Authentication with a username and web service access key.

**Can I extend the API to include additional fields?**
No. Extending standard APIs with custom fields is not currently supported.

**What is the default port for OData services?**
The default port is 7048.

**How do I find my tenant ID?**
Your tenant ID is embedded in your Business Central URL.

**What causes a 401 Unauthorized error?**
Almost always incorrect credentials or missing permissions.

**How should I handle API rate limits?**
Implement retry logic, backoff strategies, and actively monitor API usage.

Knit for Microsoft Dynamics Business Central API Integration
------------------------------------------------------------

If you don’t want to babysit authentication, versioning, and long-term maintenance, Knit offers a cleaner path. Integrate once with [Knit](/integration/ms-dynamics-business-central/), and it abstracts away authentication, authorization, and ongoing API changes for Microsoft Dynamics Business Central.

This isn’t about convenience, it’s about reducing operational drag and keeping your integration stable as APIs evolve.

 

 ![](https://storage.googleapis.com/knit-website-media/2026/08/64c34ca1e0546a9d333bb35a_Kunal-3-150x150.png)Written by Kunal Mishra

Changing integration landscape, one organization at a time‍

 

 

 

 

 

   Keep Reading
------------

  ![](https://storage.googleapis.com/knit-website-media/2026/08/blog-banner-green-640x400.png) [Tutorials](http://35.223.47.52/blogs/tutorials/) 

### [How to Create a Slack Bot in 5 Minutes: A to Z Guide](http://35.223.47.52/blog/how-to-create-a-slack-bot/)

You can create your own Slack Bot in just a few minutes with the Knit Unified API. Read this step-by-step…

 August 13, 2026 · 3 min read 

 

   ![](https://storage.googleapis.com/knit-website-media/2026/08/blog-banner-green-640x400.png) [Tutorials](http://35.223.47.52/blogs/tutorials/) 

### [How to Build and Deploy a Microsoft Teams Bot](http://35.223.47.52/blog/how-to-build-and-deploy-a-microsoft-teams-bot/)

You can either build Microsoft Teams Bot on your own or you can use Knit's Unified API to create it…

 August 13, 2026 · 4 min read 

 

   ![](https://storage.googleapis.com/knit-website-media/2026/08/blog-banner-yellow-scaled-640x400.png) [Tutorials](http://35.223.47.52/blogs/tutorials/) 

### [What Should You Look For in A Unified API Platform?](http://35.223.47.52/blog/what-should-you-look-for-in-a-unified-api-platform/)

The right unified API can solve all your integration woes at minimal effort and cost. Read this to know how…

 August 13, 2026 · 14 min read 

 

  

 

  \#1 in Ease of Integrations
---------------------------

![4.9 out of 5 stars](/wp-content/themes/knit/assets/images/g2/g2-star-rating.svg)

4.9 out of 5 stars on G2

![G2 Leader, Spring 2026](/wp-content/themes/knit/assets/images/g2/g2-leader.svg)![G2 Fastest Implementation, Spring 2026](/wp-content/themes/knit/assets/images/g2/g2-fastest-implementation.svg)![G2 High Performer, Spring 2026](/wp-content/themes/knit/assets/images/g2/g2-high-performer.svg)![G2 Best Est. ROI, Spring 2026](/wp-content/themes/knit/assets/images/g2/g2-best-roi.svg)

 

  Put Integrations on Autopilot. Talk to Experts.
-----------------------------------------------

Knit is loved by customers across the globe due to our seamless product and white glove support. You'll love us too!

 [Talk to a Human](/book-demo)
