Getting exception Invalid tax rate IDs when adding tax rate on item,
I want to add tax rate programmatically on specific item.
this how i'm doing
inventoryConnector().assignTaxRatesToItem( itemId, listTaxRates )
Thank you
Getting exception Invalid tax rate IDs when adding tax rate on item,
I want to add tax rate programmatically on specific item.
this how i'm doing
inventoryConnector().assignTaxRatesToItem( itemId, listTaxRates )
Thank you
What environment? What is your merchant id? Can you provide the data in the request you are making?
Sandbox as environment and the data in the request are making:-
item.defaultTaxRates = true val listTaxRates: ArrayList<String> = ArrayList() val taxRate = TaxRate() taxRate.isDefault = true taxRate.name = "Default" taxRate.id = item.taxRates[0].id taxRate.rate = 0 taxRate.taxAmount = 200
listTaxRates.add(taxRate.name) listTaxRates.add(taxRate.id) listTaxRates.add(taxRate.rate.toString()) listTaxRates.add(taxRate.taxAmount.toString())
try { inventoryConnector().assignTaxRatesToItem( itemId, listTaxRates ) } catch (e: java.lang.Exception) { e.printStackTrace() }
That request doesn't make much sense, you are going to end up with an arraylist with the following items:
[taxRate.name, taxRate.id, taxRate.rate, taxRate.amount]
I believe what you want is a arraylist with a single item that is the Clover uuid of the tax rate:
yes, so please can you help me how we can achieve this(add tax on item),
I have tried with different approaches.
I have also tried with
item.defaultTaxRates = true val listTaxRates: ArrayList<TaxRate> = ArrayList() val taxRate = TaxRate() taxRate.isDefault = true taxRate.name = "Default" taxRate.id = item.taxRates[0].id taxRate.rate = 0 taxRate.taxAmount = 200 listTaxRates.add(taxRate) item.taxRates=listTaxRates
this approach but it also not work.
1 Person is following this question.