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!
I'm using the standard Business central API v2! I would like to avoid creating my own API if possible.
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
Hello!
I am actually talking about moving a PurchaseInvoice from Open to Posted. Is this possible from the api?
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?
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,524 Super User 2024 Season 2
Martin Dráb 228,493 Most Valuable Professional
nmaenpaa 101,148