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

Announcements

No record found.

News and Announcements icon
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
    Microsoft Employee 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

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,986 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,071 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 975 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans