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

Community site session details

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

VAT calculation is not triggered when creating journal line through API

(4) ShareShare
ReportReport
Posted on by 6
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. 
I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    3,066 on at
    VAT calculation is not triggered when creating journal line through API
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,106

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,291 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 2,010 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans