Hi,
You cannot simply set the VAT code on an order line. Rather, the VAT code on an order line is taken from the line's product's group's account.
This is no different between the API and the web application - and thus, since it isn't really a technical question per se, you should actually speak to our normal support about it. Our colleagues there will also be much better at filling you in on the general intricacies of controlling VAT for orders and invoices

Best regards,