Skip to main content

Notifications

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

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: How to post a journal entry with VAT (taxCode) settings different than the default (via the API)

    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.

  • SteveMet Profile Picture
    15 on at
    RE: How to post a journal entry with VAT (taxCode) settings different than the default (via the API)

    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
    on at
    RE: How to post a journal entry with VAT (taxCode) settings different than the default (via the API)

    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
    RE: How to post a journal entry with VAT (taxCode) settings different than the default (via the API)

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

  • SteveMet Profile Picture
    15 on at
    RE: How to post a journal entry with VAT (taxCode) settings different than the default (via the API)

    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" ?

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: How to post a journal entry with VAT (taxCode) settings different than the default (via the API)

    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
    RE: How to post a journal entry with VAT (taxCode) settings different than the default (via the API)

    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. 

  • Marco Mels Profile Picture
    on at
    RE: How to post a journal entry with VAT (taxCode) settings different than the default (via the API)

    Hello,

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

    Thank you.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans