Skip to main content
Post a question

Notifications

Community site session details

Community site session details

Session Id : pS6A7bymc+5Vt5socNMeXK
Small and medium business | Business Central, N...
Suggested answer

API Batch and Deep insert

Like (0) ShareShare
ReportReport
Posted on 2 Jan 2023 09:53:27 by 3,058

Hi Folks,

I have one of the scenario where I am creating a header and lines in one shot using business central custom API.

I tried to refer couple of blogs example:

https://www.kauffmann.nl/2021/01/06/batch-calls-with-business-central-apis-3-tips-and-tricks/

https://www.kauffmann.nl/2020/05/05/deep-insert-with-business-central-apis/

https://www.kauffmann.nl/2020/12/18/batch-calls-with-business-central-apis-1-basic-operation/

But I am unable to get correct response.

This is the body I am passing

pastedimage1672653026527v1.png

Below is the response I am receiving 

pastedimage1672653060166v2.png

Kindly advise what is the correct step to use batch and deep insert together.

I followed same steps using business central standard API but still receiving same response.

  • Vaishnavi J Profile Picture
    3,058 on 03 Jan 2023 at 08:28:57
    RE: API Batch and Deep insert

    Hi

    The example which you  gave is for the Deep insert.

    I want to use batch and deep insert together in one single request.

    I want to create a Purchase Header and multiple lines together in one shot how would I be able to achieve this?

  • Suggested answer
    DAnny3211 Profile Picture
    9,276 Moderator on 02 Jan 2023 at 14:28:53
    RE: API Batch and Deep insert

    Hi

    I'll give you an example using the standard salesInvoices API

    GET:

    pastedimage1672669360549v1.png

    this is the response

    pastedimage1672669442517v2.png

    POST:

    insert in the body request this for example:

    {
        "externalDocumentNumber""",
        "postingDate""2021-01-19",
        "customerNumber""20000",
         "salesInvoiceLines": [
            {
                "lineType""Item",
                "lineObjectNumber""1928-S",
                 "quantity"3
     
            }
        ]
    }
    DANiele

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 293,361 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,516 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading complete