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...
Suggested Answer

VAT calculation is not triggered when creating journal line through API

(5) ShareShare
ReportReport
Posted on by 10
Hi!

I create journal lines with POST businesscentralPrefix/companies({id})/journals({id})/journalLines where I supply i.a. the taxGroup (that is setting the VAT Prod. Posting Group on the line). I have configured my journal and accounts so when my row is created it has:

Gen. Posting Type as Purchase
Gen. Bus. Posting Group as EU
VAT Prod. Posting Group as INRIKES
VAT Bus. Posting Group as EU
 
And my VAT Posting Setup table has one row with:
 
Gen. Bus. Posting Group as EU
VAT Prod. Posting Group as INRIKES
VAT % as 25
VAT Calculation Type as Normal VAT
 
But when my line is created the VAT amount is 0.00. However, if I click the VAT Prod. Posting Group and change it, to anything even the same value as it has, the VAT amount is calculated and updated. It's like the POST to the API doesn't trigger the VAT calculation in the GUI. Is there anyway for me to trigger the calculation through the API? I have tried to PATCH the journal line the taxGroup to see if it triggered but without success.
Also worth noting, when I Preview Posting the G/L and VAT entries are displayed correctly and the VAT is also calculated correctly. 
Screenshot 2025-11-12 at 13.05.57.png
Screenshot 2025-11-12 at 13.06.33.png
Screenshot 2025-11-12 at 13.06.24.png
I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    12,808 Super User 2026 Season 1 on at
    Hello,
     
    The standard journalLines API does not trigger VAT calculation.
    Business Central only calculates VAT when a user edits the line in the UI (OnValidate trigger) or when the journal is posted.
    That’s why VAT Amount stays 0.00 until you click the field manually, but Preview Posting shows the correct VAT.
    There is no API action to force VAT recalculation.
    POST/PATCH on journalLines will never run the same calculation logic as the page.
    Your options are basically:
    Ignore the VAT Amount column – posting will calculate VAT correctly.
    Calculate the VAT yourself before sending the line.
    Create a small custom API (AL extension) that calls VAT calculation server-side.
    There is no standard workaround without customization.
     
    Regards,
    Oussama Sabbouh

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,926 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,158 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 533 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans