Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Business central api POST bad request

(0) ShareShare
ReportReport
Posted on by 45

Hi

Im creating a rest api for my BC company, and i can retrieve all saleorders (Test company)

But now im following (https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_salesorder_create) to create a salesorder, but the response is pastedimage1650628338137v1.png

i tried using the company info, and also the basic example.

This is my header settings:

pastedimage1650628421052v2.png

Any suggestions on what im doing wrong?

  • Suggested answer
    Izet Profile Picture
    Izet 45 on at
    RE: Business central api POST bad request

    You are right, it works now without paymentTermsId!

    Thanks! :)

  • Suggested answer
    JAngle Profile Picture
    JAngle 63 on at
    RE: Business central api POST bad request

    if you remove the paymentTermsId do you get the same error? I have virtually the same body working correctly and I know for certain the GUID for the paymentTermsId is present in the company I am POSTing to. I use variables in my example body:

    {
        "number": "1009",
        "customerNumber": "10000",
        "currencyCode": "USD",
        "orderDate": "2021-12-31",
        "paymentTermsId": "{{paymentTermsId}}",
        "salesOrderLines": [
    	{
    		"itemId": "{{itemId}}",
    		"quantity": 1
    	}
        ]
    }

  • Izet Profile Picture
    Izet 45 on at
    RE: Business central api POST bad request

    Also my json data im sending:

    {
      "number": "1009",
      "orderDate": "2015-12-31",
      "customerNumber": "GL00000008",
      "currencyCode": "GBP",
      "paymentTermsId": "3bb5b4b6-ea4c-43ca-ba1c-3b69e29a6668"
    }

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans