Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

API Batch and Deep insert

Posted on by 3,056

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
    Vaishnavi J 3,056 on at
    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
    DAnny3211 9,272 Super User 2024 Season 1 on at
    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans