Skip to main content

Notifications

Business Central forum
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

Categories:
  • 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,190 Moderator 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 58,859 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,744 Moderator 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 58,859 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

Helpful resources

Quick Links

Dynamics 365 Community Update

Welcome to the inaugural Community Platform Update. As part of our commitment to…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Community Spotlight of the Month

Kudos to Mohana Yadav!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,142 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,979 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans