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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Purchase Invoice API Issue: Total Amounts Zero with G/L Account

(1) ShareShare
ReportReport
Posted on by 7

Hi Community,

I'm facing an issue while creating a purchase invoice with a G/L Account selected in the purchase invoice line. When I use the GET API for the purchase invoice, the following properties return a value of 0:

  • totalAmountExcludingTax
  • totalTaxAmount
  • totalAmountIncludingTax

Could you please let me know if I need to set up any changes or if there is another way to get the correct values for these properties through the API?

Thank you!

 
PurchaseInvoiceAP...

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

I have the same question (0)
  • Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at
    Are you using standard API or custom?
     
    I could not see your attachment for some reason, Please paste directly in the chat.
  • Gerardo Rentería García Profile Picture
    25,236 Most Valuable Professional on at
    Hi
    Do you have amounts in the document lines?
    BR
    GR
  • CU25061419-0 Profile Picture
    on at
    This value might be calculated at runtime, which is why it is showing up zero.

    Can you run RecordName.CalcFields('field name') and see if it populates the value.

    Sources: Record.CalcFields(Any [, Any,...]) Method - Business Central | Microsoft Learn
  • BS-27061404-0 Profile Picture
    7 on at

    I'm using the standard API: https://{businesscentralPrefix}/api/v2.0/companies({id})/purchaseInvoices({id}).

    My purchase invoice line contains values. The API returns the accurate value when the purchase invoice line is an item. However, when the purchase invoice line is a G/L Account, it returns 0.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans