Skip to main content

Notifications

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

VendorPayment POST through API does not change the status of PurchaseInvoice to PAID

(0) ShareShare
ReportReport
Posted on by 10

When POSTing a PurchaseInvoice, the status field is "read-only" and gets posted as `Draft` through the API, although in the actual application it says `Open`.

When trying to reference a PurchaseInvoice in the VendorPayment API, the VendorPayment either require the `appliesToInvoiceNumber` or `appliesToInvoiceId` fields filled out. When I use the `appliesToInvoiceId`, I get an error that says "The \"appliesToInvoiceId\" should be the ID of an Open, Paid, Corrective, or Canceled Invoice." However, when using the `appliesToInvoiceNumber`, the VendorPayment gets posted, but does not change the status of the PurchaseInvoice to Paid. How can I change the status of the PurchaseInvoice to paid when POSTing a VendorPayment specifically for that PurchaseInvoice?

Thank you in advance!

  • kitani Profile Picture
    kitani 10 on at
    RE: VendorPayment POST through API does not change the status of PurchaseInvoice to PAID

    I'm using the standard Business central API v2! I would like to avoid creating my own API if possible.

  • Suggested answer
    Vaishnavi J Profile Picture
    Vaishnavi J 3,056 on at
    RE: VendorPayment POST through API does not change the status of PurchaseInvoice to PAID

    Hi,

    Have you created your own API or are you using standard Business central API?

    And what is the version you are using v1 or v2.

    Can you insert the Purchase Invoice first trough API and then do a get request to check status field is in draft or not and then post it from front end and check the status of PPI by doing a get request is it Open or Draft?

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

  • kitani Profile Picture
    kitani 10 on at
    RE: VendorPayment POST through API does not change the status of PurchaseInvoice to PAID

    Hello!

    I am actually talking about moving a PurchaseInvoice from Open to Posted. Is this possible from the api?

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: VendorPayment POST through API does not change the status of PurchaseInvoice to PAID

    Are you talking about the closed filed on the posted purchase invoices?

    If so can you provide a sample showing the vendor ledger entries that is generated from posting of the invoice and the payment?

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: VendorPayment POST through API does not change the status of PurchaseInvoice to PAID

    Hello,

    Interesting questions, if you are not getting further responses from the community, please consider raising a ticket to Microsoft via your partner or CSP.

    Thank you.

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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans