web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
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?


I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    90,204 Super User 2025 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
    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
    90,204 Super User 2025 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
    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
    90,204 Super User 2025 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,708

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,675 Super User 2025 Season 2

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,203

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans