netsuitesuitetalk

Overriding NetSuite calculated tax amount on Vendor Credits using SuiteTalk SOAP api


I have a question regarding overriding NetSuite auto calculated tax amount on Vendor Credits using SOAP and appreciate your help.

Background Our application is working with legacy tax feature of NetSuite where Tax Codes can be specified per Expense lines and NetSuite auto calculates tax amount. For example, assuming a subsidiary with Australian tax nexus, when a tax code of 10% is specified for a line with amount 100$, NetSuite calculates tax as 10$. However, the NetSuite user interface also allows overriding that amount by user. For example, if the tax amount on actual user's document is 9.99$, user can override that value in the UI. We are trying to perform similar overriding operation using SOAP API. Since this is possible in the UI, I assume it should also be possible on the API.

editing tax total in the UI

I performed similar operation for Vendor Bill successfully by first creating the Vendor Bill and then updating the transaction by specifying the taxTotal field: taxTotal schema field.

However, trying the similar operation for Vendor Credits was unsuccessful. There is no taxTotal field on Vendor Credit schema, and using the only similar field which was userTaxTotal did not work.

I was wondering is it possible to accomplish this using the SOAP API for Vendor Credits?

Thanks for your help.

This xml code shows the request that we are sending to create the Vendor Credit. As a result, NetSuite creates a Vendor Credit with 110$ (10$ for tax is auto calculated by NetSuite for the given tax code).

<SOAP-ENV:Header>
        <ns4:tokenPassport xsi:type="ns3:TokenPassport">
            <!--authentication properties-->
        </ns4:tokenPassport>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns2:upsert>
            <ns2:record xsi:type="ns1:VendorCredit" externalId="5A8B18E92971B6F31832B0AED866EF95">
                <ns1:account internalId="176"/>
                <ns1:tranId>CRED_JAN26_2023_T1</ns1:tranId>
                <ns1:entity internalId="1552"/>
                <ns1:currency internalId="1"/>
                <ns1:tranDate>2023-01-01T00:00:00</ns1:tranDate>
                <ns1:postingPeriod internalId="382"/>
                <ns1:memo/>
                <ns1:subsidiary internalId="7"/>
                <ns1:expenseList>
                    <ns1:expense>
                        <ns1:account internalId="38"/>
                        <ns1:amount>100</ns1:amount>
                        <!-- tax code corresponding to 10 percent -->
                        <ns1:taxCode internalId="1044"/>
                        <ns1:memo/>
                        <ns1:department internalId="11"/>
                        <ns1:class internalId="13"/>
                        <ns1:location internalId="7"/>
                    </ns1:expense>
                </ns1:expenseList>
            </ns2:record>
        </ns2:upsert>
    </SOAP-ENV:Body>

and here is the update request we are sending to update the tax total:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:purchases_2022_1.transactions.webservices.netsuite.com" xmlns:ns2="urn:messages_2022_1.platform.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="urn:core_2022_1.platform.webservices.netsuite.com" xmlns:ns4="ns">
    <SOAP-ENV:Header>
        <ns4:tokenPassport xsi:type="ns3:TokenPassport">
            <!--authentication properties-->
        </ns4:tokenPassport>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns2:update>
            <ns2:record xsi:type="ns1:VendorCredit" externalId="5A8B18E92971B6F31832B0AED866EF95">
                <ns1:userTaxTotal>9.99</ns1:userTaxTotal>
            </ns2:record>
        </ns2:update>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Although this doesn't fail, it does not change the value of tax total.


Solution

  • In SuiteTalk SOAP, the tax total fields are read only. You have to set the taxRate1 and taxRate2 fields to update the tax rates. While I have not tried it before since most of the implementations I have worked on use avalara, you may also be able to try the tax1Amt field. Depending on how you have configured taxes (and if there are third party tax integrations like avalara) you may also have to configure a custom taxCode that is amenable to being overridden.