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

How to post a journal entry with VAT (taxCode) settings different than the default (via the API)

(0) ShareShare
ReportReport
Posted on by 15

We use the API (v2) to export journal lines to Business Central.

When we post an entry we don't have all the features like when we enter manualy a line, especially concerning taxes.

We only have a field "taxCode". But the system ignores what is set in this field and when we edit the journal on Business Central, it seems settings are still the default for the account. 

Does someone has any idea how to correct this behaviour ?

Have a nice day 

Steve

I have the same question (0)
  • Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    Best probably is to post your JSON so anyone can take a look.

    Thank you.

  • SteveMet Profile Picture
    15 on at

    POST {{baseUrl}}companies({{companyId}})/journals({{journalId}})/journalLines
    {
      "accountNumber": "3203",
      "postingDate": "2022-10-12",
      "documentNumber": "1234",
      "amount": 1300,
      "description": "test",
      "comment" : "test comment",
      "taxCode" : "NORMAL"
    }

    this works to post a new line in a journal. But in the documentation it seems there is no way to fill these fields in

    pastedimage1665642023248v1.png

    in the documentation, these fields don't seem to appear : 

    journalLine resource type - Business Central | Microsoft Learn

    pastedimage1665642137255v2.png

    Seems that these fields are set directly from the config of each account. 

  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    At my side it works fine:

    pastedimage1665747464097v1.png

    api.businesscentral.dynamics.com/.../{{TENANTAADID}}/{{PRODUCTION}}/api/v2.0/companies({{COMPANY}})/journals({{JournalID}})/journalLines

    {
      "Description""Test1",
      "accountNumber" "10000",
      "taxCode""FULL RED"
    }
    This is tested in BC21 SaaS. What release are you testing with?
    Thanks.
  • SteveMet Profile Picture
    15 on at

    Thanks for the suggestion, unfortunately, how to specify "VAT Bus. Posting Group", if we can only set "taxCode", which I guess is "VAT Prod. Posting Group". Here is the table of my customer (VAT posting setup) :

    2022_2D00_10_2D00_18_5F00_17_2D00_33_2D00_22.png

    if I post "NORMAL" in the taxcode, how or where to post "NATIONAL" or "EXPORT" ?

  • SteveMet Profile Picture
    15 on at

    I use BC online, I don't know where to find the version ? I tried to find "version" in the search menu, without success.

  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    Thank you for the message. Now I see what you mean. The field taxCode is linked to VAT Prod. Posting Group. You want to populate data in field VAT Bus. Posting Group. I assume that these have been been populated in the API, so you need to create a custom API for t his where you expose these yourself.

    Hope it helps.

  • SteveMet Profile Picture
    15 on at

    thanks for the answer...

    I am little bit disappointed that the standard API doesn't allow to post standard bookkeeping entries :(

  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    You can of course raise a feature suggestion via https://aka.ms/bcideas . We are open for suggestion. Also you can verify what is exposed out of the box and what has not been exposed yet via:

    api.businesscentral.dynamics.com/.../$metadata

    Hope at least this helps.

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,012 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 986 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 659 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans