Skip to main content

Notifications

Business Central forum
Unanswered

Creating Purchase Invoice "Lines" with multiple VAT Rates via API V2

editSubscribe (0) ShareShare
ReportReport
Posted on by 5
Hi,
 
I'm currently trying to create Purchase invoices with lines using the below documentation below,
 
I will only be creating lines with the type /G/L Account/ and need to have the ability to set different VAT Codes (VAT Prod Posting Groups) on each line.
 
For example: i buy a range of food and drink items from a supplier, some of which is taxed and some of which is not but all items fall under the same G/L Account.
 
When i try to create a line and populate the /taxcode/ with one of my VAT Prod posting groups it seems to get ignored and the VAT Prod Posting Group on each line is blank.
 
The provided example is not great as it only shows the Type /Item/ and lists the tax code as /Furniture/
 
 
 
Am i correct in saying that the /taxcode/ field above relates to the code in the table  below? 
 
 
Any insight as to why this isn't working  or how i can get around this would be greatly appreciated .
 
Cheers
  • CU30041016-0 Profile Picture
    CU30041016-0 5 on at
    Creating Purchase Invoice "Lines" with multiple VAT Rates via API V2
    Thanks KasparsSemjonovs for your response. 
     
    I have seen that if i put a a VAT Prod Posting group in the G/L Account that all lines then have this as you mentioned.
    Splitting out the G/L Accounts will not always be something that we can do as we will be working with multiple clients who have control of their own chart of accounts.
     
    Can i just confirm your recommendation is to post the lines (with or without the Vat Prod Posing Group depending on if its in the GL Account) then make a another call to "update" the lines and in that call update each line with the specific Vat code?
     
     
    Thanks
  • KasparsSemjonovs Profile Picture
    KasparsSemjonovs 3,099 Super User on at
    Creating Purchase Invoice "Lines" with multiple VAT Rates via API V2
    Most likely it is because in the G/L account card the VAT Prod. Posting group is empty, that is why all lines have this value empty. 
    Then there is a problem, how the values are passed to the line - I assume that You need to initially create the line with the Line type and No. created, and afterwards You need to modify the VAT Prod. Posting Group in the line, because standard procedure ignores what goes with and just pulls the value from G/L account card.
     
    The same goes for Items - You should fill in the VAT Prod. Posting group in the items as well.
     
    The best option would be to have separate G/L accounts and Items with the specific VAT Prod. Posting groups assigned, and then from API You would have no problems.

Helpful resources

Quick Links

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,373 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,212 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans