Skip to main content

Notifications

Announcements

No record found.

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

Business Central API salesInvoices issue

Posted on by 134

Hi everyone,

I'm new in field of API in business central. 

Scenerio:- I'm using standard API of business central "salesInvoices" 

GET Call = https://api.businesscentral.dynamics.com/v2.0/(my tenant id)/(my sandbox)/api/v2.0/companies(my company id)/salesInvoices

It returns me all Posted and non-Posted Sales Invoices, BUT

there is a field with name "Status", it tells us the status of invoice

Image

Image

my point of view is that is how can we differentiate between Posted and non-Posted sales Invoice because Open status can be for both Posted and non-Posted invoices? 

Should there not be two different entities for Posted and non-Posted invoices?

  • YUN ZHU Profile Picture
    YUN ZHU 73,696 Super User 2024 Season 2 on at
  • Abdullah Khalid Profile Picture
    Abdullah Khalid 134 on at
    RE: Business Central API salesInvoices issue

    Hi Daniele Incalza, thanks for your response.

    I looked into response one by one every field but I can't find such boolean field "IsPosted" in my response.

    Can you please let me know or can show me how can I get that field?

  • DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: Business Central API salesInvoices issue

    hi

    Regarding your scenario, you are correct that the "Status" field alone cannot be used to differentiate between posted and non-posted invoices, as both posted and non-posted invoices can have an "Open" status.

    However, the API provides other fields that can be used to identify whether an invoice is posted or not. One such field is the "IsPosted" field, which is a Boolean field that indicates whether an invoice has been posted or not. You can use this field to filter and retrieve only posted or non-posted invoices.

    To answer your question, it is not necessary to have separate entities for posted and non-posted invoices, as the API provides fields that allow you to distinguish between them. Instead, you can filter and retrieve only the invoices that meet your criteria using the available fields.

    DAniele

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