Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

Fetching Posted Payments - API/Odata

Posted on by
I've been trying to fetch all posted payments using the V2 Apis.

The /customerpayments and /vendorpayments endpoint return only the draft payments (journal lines).
I am now trying to fetch the posted payments from the VendorLedgerEntries and Cust_LedgerEntries endpoints using Odata but i only get the contact and invoice document numbers. Is there any way from which i can directly get the posted payments with the proper contact and invoice platform unique id.

If not possible, how can i create a custom web service to fetch the posted payments.
  • Aaron Bauldree Profile Picture
    Aaron Bauldree 21 on at
    Fetching Posted Payments - API/Odata

    To fetch posted payments via API, you're looking in the right place by checking the Customer Ledger Entries. While I'm not familiar with the exact data on that page, I can share my experience with custom API pages for similar data.

    If you need more details about the Customer and Invoice for each payment, you have a couple of options:

    1. Request Ledger Entries and Loop Through: You can request the Ledger Entries and then loop through them, making separate API calls to fetch the customer and invoice details. While this method works, it can be somewhat heavy and less efficient.

    2. Create a Custom API Page: A better approach would be to expand the custom API page for the Customer Ledger Entries to include the necessary fields from the Customer and Invoice tables. Once you've created this custom page in BC, you can publish it as a Web Service.

    By creating a custom API page, you can directly get the posted payments with the proper contact and invoice platform unique IDs.

  • gdrenteria Profile Picture
    gdrenteria 12,183 Most Valuable Professional on at
    Fetching Posted Payments - API/Odata
    Hi
    I hope this can help you and give you some hints.
    BR
    GR

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans