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
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?
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?
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
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... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156