Skip to main content

Notifications

Announcements

No record found.

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

Can't able to Get Customer Payment through API v2.0

(1) ShareShare
ReportReport
Posted on by 20
I can't able to find customer payment through this api :
https:/api.businesscentral.dynamics.com/v2.0/{{TeantID}}/{{env_name}}/api/v2.0/companies({{company_id}})/customerPayments


giving me value empty :
{

    /@odata.context/: https:/api.businesscentral.dynamics.com/v2.0/{tenant} /{env}/api/v2.0/$metadata#companies({com-id})/customerPayments/,
    /value/: []
}

But see i have 2 records there.
How can i get those 2 records using API v2.0?


  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 74,115 Super User 2024 Season 2 on at
    Can't able to Get Customer Payment through API v2.0
    As far as I know, it's not possible with the standard API.
    There are generally two ways to do this:
    1. Let the API return the results you need: As of now, the standard API is not extensible
    2. Find the records in the posted table: There are two tables to look at. But neither has a standard API.
     
    Hope this helps.
    Thanks.
    ZHU
  • Kanta Profile Picture
    Kanta 20 on at
    Can't able to Get Customer Payment through API v2.0
    Thanks a lot YUN ZHU,
    can you do me one more favor please.

    when i'm posting cash recipt journal record my webhook give me response like this.
    But as the line is posted, it got delete from customerPayments, so i can't get the relevent information about the customerPayment. i need to know which customer has paid on which invoice. 
    how can i get the information?
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 74,115 Super User 2024 Season 2 on at
    Can't able to Get Customer Payment through API v2.0
    Hi, Sorry, it looks like you are doing it right. However, Microsoft has filtered the results. The following three conditions must be met to obtain them from the standard API.
     
    Two Examples:
    https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox241/api/v2.0/companies(938320db-e10b-ef11-9f8d-6045bdacaf36)/customerPaymentJournals?$expand=customerPayments
     
    https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox241/api/v2.0/companies(938320db-e10b-ef11-9f8d-6045bdacaf36)/customerPayments?$filter=journalId eq 587cf070-a414-ef11-9f88-000d3a50c332 and id eq f7afd139-4621-ef11-9f88-00224868ce08
     
    PS: When taking values ​​directly, you must add at least one filter.
     
    Hope this helps.
    Thanks.
    ZHU
  • Kanta Profile Picture
    Kanta 20 on at
    Can't able to Get Customer Payment through API v2.0
    Thank you for your guide, Mr. YUN ZHU.
    I actually tried putting system id in URL like this /customerPayments({systemId})
    but I am getting error resource not found.
    I'm not getting it, why I can't get those record, or how should I approach to get those records?


  • YUN ZHU Profile Picture
    YUN ZHU 74,115 Super User 2024 Season 2 on at
    Can't able to Get Customer Payment through API v2.0
    Hi, Try adding SystemId?
     
     
    Hope this can give you some hints.
    Thanks.
    ZHU
     

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

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans