Skip to main content

Notifications

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

Posting of Purchase order Invoice with the API

Posted on by 15

I am trying to post Purchase invoice but getting co-relation error 

Can somebody help me

  • Skyscend Profile Picture
    Skyscend 15 on at
    RE: Posting of Purchase order Invoice with the API

    Thank you, Daniele, for the response.

    I am trying to post invoice against the purchase order do you have working request body for posting of invoice against purchase order.

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: Posting of Purchase order Invoice with the API

    Hi
    delete the ID attribute in the body request, it will be assigned automatically by the system

    this is ny example

    WITH ID in request BODY:

    pastedimage1676105980594v1.png

    WITHOUT ID IN REQUEST BODY:

    pastedimage1676106071604v2.png

    check my answer if it helped you, thanks

    DAniele

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: Posting of Purchase order Invoice with the API

    Search for Web Services page and click new

    Select object type as Page and enter Object ID as30066 give it a name. in my case purchaseOrders

    Set Publish boolean to true

  • Skyscend Profile Picture
    Skyscend 15 on at
    RE: Posting of Purchase order Invoice with the API

    Could you please elaborate more on publish the page 30066 in web services

  • Skyscend Profile Picture
    Skyscend 15 on at
    RE: Posting of Purchase order Invoice with the API

    Thank you for sharing.

    Now I see below error.

    pastedimage1675565464245v1.png

    Here is request body

    {
    "id": "fd041e73-67a3-ed11-9a88-0022481d0e9a",
    "number": "106012",
    "orderDate": "2022-04-13",
    "postingDate": "2022-04-13",
    "vendorId": "77b117ef-e06c-ed11-81b5-6045bd8e591f",
    "vendorNumber": "20000",
    "vendorName": ""First Up Consultants",
    "payToName": "First Up Consultants",
    "payToVendorId": "77b117ef-e06c-ed11-81b5-6045bd8e591f",
    "payToVendorNumber": "20000",
    "shipToName": "CRONUS USA, Inc.",
    "shipToContact": "100 Day Drive",
    "buyFromAddressLine1": "",
    "buyFromAddressLine2": "",
    "buyFromCity": "Chicago",
    "buyFromCountry": "",
    "buyFromState": "",
    "buyFromPostCode": "",
    "payToAddressLine1": "",
    "payToAddressLine2": "",
    "payToCity": "",
    "payToCountry": "",
    "payToState": "",
    "payToPostCode": "",
    "shipToAddressLine1": "",
    "shipToAddressLine2": "",
    "shipToCity": "",
    "shipToCountry": "",
    "shipToState": "",
    "shipToPostCode": "",
    "currencyId": "00000000-0000-0000-0000-000000000000",
    "currencyCode": "USD",
    "pricesIncludeTax": "",
    "paymentTermsId": "86b017ef-e06c-ed11-81b5-6045bd8e591f",
    "shipmentMethodId": "",
    "purchaser": "",
    "requestedReceiptDate": "2022-04-14",
    "discountAmount": "",
    "discountAppliedBeforeTax": "",
    "totalAmountExcludingTax": "",
    "totalTaxAmount": "",
    "totalAmountIncludingTax": "",
    "fullyReceived": "",
    "status": "Open"
    }

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Posting of Purchase order Invoice with the API

    To post a purchase order you should use the bound action available in the Purchase order API as documented here:

    learn.microsoft.com/.../dynamics_purchaseorder

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: Posting of Purchase order Invoice with the API

    You have to use the below link

    api.businesscentral.dynamics.com/.../NAV.ReceiveAndInvoice

    Publish the page 30066 in web services first

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans