web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

want to send invoice related and customer related data in dynamic 365 business solutions

(2) ShareShare
ReportReport
Posted on by 4
Hi, hope you are fine , 
sir I want to send customer data and invoice data into dynamic 365 business solution, through .net mvc using your api's. can we use exiting api's which are provided by dynamic 365. 
and also can we create trial account from pakistan on dynamic 365 business solution.
THanks
Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    239,680 Most Valuable Professional on at
    Which D365 product are you using? The D365 brand covers quite a few products, such as Finance and Operations, Business Central or Customer Engagement. Note that none is called Dynamic 365 Business Solution.
  • Suggested answer
    Saif Ali Sabri Profile Picture
    2,612 Moderator on at

    Yes, you can send customer and invoice data to Dynamics 365 Business Central using Microsoft's existing APIs. Business Central provides OData and REST APIs that allow you to interact with customer and sales data programmatically.


    Solution Approach: Using Business Central API in .NET MVC

    Step 1: Enable API Access in Business Central

    1. Sign in to Business Central as an administrator.
    2. Enable Web Services:
      • Navigate to Search (Alt + Q) > Web Services.
      • Ensure the required APIs (like customer, salesInvoice) are published.
    3. Get API URL:
      • The base API URL format is:
        arduino
        https://api.businesscentral.dynamics.com/v2.0/{tenant_id}/{environment}/ODataV4/

    Step 2: Authenticate with Business Central API

    You must use OAuth 2.0 authentication via Azure Active Directory (Azure AD).

    1. Register an App in Azure AD:

      • Go to Azure Portal > Azure Active Directory > App Registrations.
      • Register your application and set up permissions for Business Central.
      • Get Client ID, Client Secret, and Tenant ID.
    2. Grant API Permissions:

      • Navigate to API Permissions in Azure.
      • Add permissions for Dynamics 365 Business Central (Financials.ReadWrite.All).
      • Grant admin consent.
    3. Obtain Access Token via OAuth:

      • Use the following token endpoint:
        bash
        https://login.microsoftonline.com/{tenant_id}/oauth2/token
      • Pass your Client ID, Client Secret, and Tenant ID to get an access token.

    Step 3: Send Customer & Invoice Data Using .NET MVC

    Use HttpClient in .NET MVC to send data to Business Central.

    Example: Sending Customer Data

    csharp
    using System;
    using System.Net.Http;
    using System.Text;
    using System.Threading.Tasks;

    public class BusinessCentralService
    {
    private static readonly string apiUrl = "https://api.businesscentral.dynamics.com/v2.0/{tenant_id}/Production/ODataV4/companies({company_id})/customers";
    private static readonly string accessToken = "your_access_token";

    public static async Task CreateCustomer()
    {
    var client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);

    var customerData = new
    {
    displayName = "New Customer",
    email = "customer@example.com",
    phoneNumber = "123456789"
    };

    var json = Newtonsoft.Json.JsonConvert.SerializeObject(customerData);
    var content = new StringContent(json, Encoding.UTF8, "application/json");

    var response = await client.PostAsync(apiUrl, content);
    var responseBody = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseBody);
    }
    }

    Example: Sending Invoice Data

    csharp
    var salesInvoiceData = new
    {
    customerId = "CUSTOMER_ID",
    invoiceDate = DateTime.UtcNow.ToString("yyyy-MM-dd"),
    salesInvoiceLines = new[]
    {
    new { itemId = "ITEM_ID", quantity = 1, unitPrice = 100 }
    }
    };

    var json = Newtonsoft.Json.JsonConvert.SerializeObject(salesInvoiceData);
    var content = new StringContent(json, Encoding.UTF8, "application/json");
    var response = await client.PostAsync(apiUrl + "/salesInvoices", content);

    Step 4: Testing & Deployment

    1. Test API Calls using Postman before implementing in .NET MVC.
    2. Handle Errors Properly (401 Unauthorized, 403 Forbidden, etc.).
    3. Deploy to Azure App Service if needed.

    Business Central Trial Account in Pakistan

    Yes, you can create a free trial account in Dynamics 365 Business Central, but availability in Pakistan may be restricted.

    Steps to Get a Trial Account:

    1. Go to Microsoft Dynamics 365 Business Central Trial
    2. Sign up with a Business Email (personal emails like Gmail/Yahoo may not work).
    3. If Pakistan is unavailable, try using Microsoft Partner support or a VPN for registration.

    Final Recommendations

    ✅ Use OAuth 2.0 for authentication.
    ✅ Send data using Business Central APIs (OData/REST).
    ✅ If Pakistan is restricted for trials, try a Microsoft Partner workaround.

    Saif Ali Sabri, FAISALABAD, PAKISTAN +923007960782

  • Martin Dráb Profile Picture
    239,680 Most Valuable Professional on at
    All right, users abusing AI to spam this forum don't care which product it's about. They still can give you a very detailed answer, regardless of whether it's relevant or complete rubbish.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 658 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 632 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 570

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans