Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Error creating customer in Business Central through API: Request data is invalid

Posted on by 5

Hi,

I am trying to create a customer through the API and I am getting a "Request data is invalid" error.

I am posting to  api.businesscentral.dynamics.com/.../customers

The following json:

{

number: "43000003",

displayName: "Sample Customer API",
}
Any ideas on what's going on? The documentation is not clear on what fields are required.
Categories:
  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: Error creating customer in Business Central through API: Request data is invalid

    Hello,

    Microsoft Business Central support is primarily provided to partner or CSP's (Cloud Solution Providers). This is because partners are able to modify the base product which means they should evaluate first if it is something in their IP or ours.

    There is a grey area of customers who are evaluating the product and do not yet have a partner or CSP assigned. They sometimes raise support tickets with Azure support, and they sometimes get lost if the Azure support area as there are several support teams out there providing support for several areas of the Azure service. Best probably is to clearly tell them this is for Business Central support. We will probably need to evaluate on a case-by-case base if customers are entitled to get to Business Central support, but the Azure support engineer needs to reach out to us otherwise we do not know that a support ticket is waiting for us (so we surely need to improve in this area on our side).

    Customers who have a paid production license do have a partner or CSP assigned so they can get to us fairly easily.

    Thank you.

  • Pablo Caselas Profile Picture
    Pablo Caselas 5 on at
    RE: Error creating customer in Business Central through API: Request data is invalid

    We don't have a partner yet because we're still evaluating Business Central (we're talking to one, though). But we need to know if the API suits us first. Because if the API doesn't fit our requirements, the product won't be a fit for us.

    How can I raise a CSP? Because I've been in previous talks with Microsoft Support due to problems with Azure Portal while creating the oauth app to consume the API, I've replied to the email with the case Azure Portal case yesterday, but got no reply. I don't know if I need to raise it for somewhere else.

    Thanks for your help Marco Mels 

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: Error creating customer in Business Central through API: Request data is invalid

    Hello,

    Feel free to raise the scenario to us at Microsoft via your partner or CSP.

    Thank you.

  • Pablo Caselas Profile Picture
    Pablo Caselas 5 on at
    RE: Error creating customer in Business Central through API: Request data is invalid

    I created a CRONUS account (I've previously deleted the one that was included) using this flags:

    Captura-de-Pantalla-2022_2D00_10_2D00_17-a-las-10.34.34.png

    But same error. I think there's something wrong with my account. I've been having other problems before this (a tenant without a global admin), then an error granting permissions to the app that got solved with the help of Microsoft support...

    Who could I talk within Microsoft to try to solve this issue?

    Captura-de-Pantalla-2022_2D00_10_2D00_17-a-las-11.38.20.png

    Thank you very much for the help! Marco Mels 

    Kind regards,

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: Error creating customer in Business Central through API: Request data is invalid

    Hello,

    Try to connect to a CRONUS Company as it has all relevant demo data included.

    Thank you.

  • Pablo Caselas Profile Picture
    Pablo Caselas 5 on at
    RE: Error creating customer in Business Central through API: Request data is invalid

    Hi, thanks for the response! Where can I see what required master data is missing?

    Edit*:

    I went ahead and created a new company for testing purposes called "test-api".

    Went to settings > company information and filled all required fields. 

    But I am still getting the same Bad Request error. 

    Kind regards,

    Pablo

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: Error creating customer in Business Central through API: Request data is invalid

    Hello,

    The following works fine:

    https    :    //api.businesscentral.dynamics.com/v2.0/{{TENANTAADID}}/{{PRODUCTION}}/api/v2.0/companies({{COMPANY}})/customers

    JSON:

    {

       "number": "43000",

       "displayName": "Sample Data"

    }

    {

       "@odata.context": "api.businesscentral.dynamics.com/.../$metadata

       "@odata.etag": "W/\"JzE5OzYwOTM2NTIwODQxMDU4ODU1ODYxOzAwOyc=\"",

       "id": "826ed5ad-be4b-ed11-946f-000d3abc180b",

       "number": "43000",

       "displayName": "Sample Data",

       "type": "Person",

    Etc.

    I see you are using My Company, could it be that this company is empty and not yet filled with the required master data?

    Thank you.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans