Skip to main content

Notifications

Business Central forum
Suggested answer

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

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!

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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans