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

Notifications

Announcements

Community site session details

Community site session details

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

Web services | Invoice Lines in batch requests no longer working

(0) ShareShare
ReportReport
Posted on by 25

We are using the Business Central Web services to POST new invoices (such as Sales Invoices, Purchase Invoices, Credits, etc..). When POSTing the data, we use Batch Requests (with the Isolation header) to insert lines and headers at the same time.

Everything worked well until we updated to the latest version of BC. We now receive the following error message when trying to do a batch request with both header and lines in the same request:

{ "error": { "code": "BadRequest", "message": "Invalid Request Body CorrelationId: 6f823976-f6f6-46f9-a6bb-ba06f19bb3c4." } }

After some testing, I found out that, if I only try to add the headers through batch request, it works, but if I try to do the same with the lines, it doesn't work.

Adding lines through normal POST requests (not batch), works.

So it seems like adding lines through batch requests isn't working anymore or isn't working the same as before.

Is anybody else having this issue or knows what it could be related to ?

Thanks, David

Here is an example I tested:

Posting this works:

{
                "@odata.etag""",
                "Document_Type""Invoice",
                "Document_No""24005914",
                "Type""G/L Account",
                "No""53510",
                "Location_Code""",
                "Unit_of_Measure""",
                "Quantity"1.0,
                "Direct_Unit_Cost"371.20,
                "Tax_Area_Code""QC",
                "Tax_Group_Code""TAXABLE",
                "Shortcut_Dimension_1_Code""111"

}
But posting this does not work
{
    "requests": [
        {
            "method""POST",
            "id""r0",
            "url""Company('comp')//PurchaseLinesSynchro",
            "headers": {
                "Content-Type""application/json;IEEE754Compatible=true"
            },
            "body": {
                "@odata.etag""",
                "Document_Type""Invoice",
                "Document_No""24005914",
                "Type""G/L Account",
                "No""53510",
                "Location_Code""",
                "Unit_of_Measure""",
                "Quantity"1.0,
                "Direct_Unit_Cost"371.20,
                "Tax_Area_Code""QC",
                "Tax_Group_Code""TAXABLE",
                "Shortcut_Dimension_1_Code""111"
            }
        }
    ]
}
I have the same question (0)
  • Verified answer
    David Gaulin Profile Picture
    25 on at

    After a lot of testing, I found out that the "int and floats" type of fields need to be writing as STRINGS. I don't know why it changed but, it is what it is.

    Here is an example of what would have worked:

    {

       "requests": [

           {

               "method": "POST",

               "id": "r0",

               "url": "Company('comp')//PurchaseLinesSynchro",

               "headers": {

                   "Content-Type": "application/json;IEEE754Compatible=true"

               },

               "body": {

                   "@odata.etag": "",

                   "Document_Type": "Invoice",

                   "Document_No": "24005914",

                   "Type": "G/L Account",

                   "No": "53510",

                   "Location_Code": "",

                   "Unit_of_Measure": "",

                   "Quantity": "1.0",

                   "Direct_Unit_Cost": "371.20",

                   "Tax_Area_Code": "QC",

                   "Tax_Group_Code": "TAXABLE",

                   "Shortcut_Dimension_1_Code": "111"

               }

           }

       ]

    }

  • Andy Sather Profile Picture
    on at

    Thank you for posting back your answer.

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

News and Announcements

Season of Giving Solutions is Here!

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 1,573

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 773 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 760 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans