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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

REST API - Find out whether a sales invoice has been posted

(0) ShareShare
ReportReport
Posted on by 15

Hi,

We'd like to use the Dynamics Business Central REST API to find out if a sales invoice has been posted.

There's no "posted" field on the salesInvoice API endpoint. However, it does have a "status" field. Can this field be used to determine posted status?

From some quick experimentation, it seems that "Draft" == not posted, and "Open"/"Paid" == posted. But I'm not sure if this is 100% reliable.

I also found this page, which seems to suggest it cannot be relied on: https://experience.dynamics.com/ideas/idea/?ideaid=662fd581-c9b8-e911-b083-0003ff689d13

Any help would be appreciated!

I have the same question (0)
  • Suggested answer
    Javier.Armesto Profile Picture
    14 User Group Leader on at

    Hello, you would have to check two fields:Sales Document Status and yet another status field, based on the enum Invoice Entity Aggregate Status what is it that you are checking.

    Invoice Posted :

    Sales Document Status==released & &

    Invoice Entity Aggregate Status”==Open or paid.

    Status fields have a different meaning in APIs than in Business Central

    Este post te ayudara: https://www.kauffmann.nl/2021/04/16/extending-standard-apis-2/

    If the answer has served you, please check the answer. It is helpful for other users. 

  • Nick22 Profile Picture
    15 on at

    Thanks for your reply. Would you happen to know if the Sales Document Status is available through the REST API? I looked for it but couldn't find it.

  • Suggested answer
    Javier.Armesto Profile Picture
    14 User Group Leader on at

    The option would be to make a custom API and add that field. The approach would be to clone the page api salesinvoices and extend the field . You can consult: github.com/.../app

  • Nick22 Profile Picture
    15 on at

    We were hoping to avoid writing a custom API, but regardless that's good to know. Thank you for your help!

  • Suggested answer
    Javier.Armesto Profile Picture
    14 User Group Leader on at

    The If you don't want to code a custom api in AL. This might help:

    Posted Date is the date that sales invoice is Posted. If inot null with combination the field Status  Open or Paid value.

    Maybelline is a solution for you.

    Remember to mark as a valid solution if I have been of help. Other users will be able to consider this answer for a similar problem

  • Nick22 Profile Picture
    15 on at

    Thank you for the suggestion. I looked into to this, however, the postingDate field can be set even if the invoice is in a draft state.

    So it seems like it cannot be used to differentiate posted vs non posted unfortunately.

  • Gabriel Prinz Landeo Profile Picture
    35 on at

    Perfecto

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,382 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,625 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,376

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans