web
You’re offline. This is a read only version of the page.
close
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?

I have the same question (0)
  • Izet Profile Picture
    45 on at

    Also my json data im sending:

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

  • Suggested answer
    JAngle Profile Picture
    133 on at

    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
    	}
        ]
    }

  • Suggested answer
    Izet Profile Picture
    45 on at

    You are right, it works now without paymentTermsId!

    Thanks! :)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,990

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,576 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,028 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans