Ajmal M A avatar image
Ajmal M A asked Mateus commented

SecurityException: Access denied to package When Create TaxRate

When I tried to add tax rate to each inventory item using following code :

TaxRate taxRate = new TaxRate();
taxRate.setName("Custom Taxes");

inventoryConnector.createTaxRate(taxRate); // Exception happend here

List<TaxRate> taxRates = new ArrayList<TaxRate>();

The following security exception throughs :

 java.lang.SecurityException: Access denied to package 
     at android.os.Parcel.readException(
     at android.os.Parcel.readException(
     at com.clover.sdk.v3.inventory.IInventoryService$Stub$Proxy.createTaxRate(
     at com.clover.sdk.v3.inventory.InventoryConnector$

I have already added all permissions and installed from sandbox appstore as shown below: image description

Please help me to solve this issue.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

sam avatar image
sam Deactivated answered Mateus commented

Hi Ajmal, This is a bug we're aware of and working actively to fix. I'll keep you update on the resolution.

In the meantime, I would recommend using our REST endpoint to create a new TaxRate.

POST /v3/merchants/{mId}/tax_rates


  "isDefault": false,
  "rate": "long",
  "name": ""

After which you should be able to associate the taxRate to an item.

               try {
                    List<String> taxRates = new ArrayList<String>();
                    mInventoryConnector.assignTaxRatesToItem([item_id], taxRates);
                } catch (Exception e) {
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

If I call the assignTaxRatesToItem method after a successful response from the previous call(create tax rate), I get the error "com.clover.sdk.v1.ClientException: status code: 400 Invalid tax rate IDs". It looks like the tax rate is not synced yet. If I go to the setup app, the tax rate is not there either. It only appears after I click on the sync button(top right corner). Isn't there a way to have the tax rate synced faster? For my use case, I need to assign the tax rate to an item right after the tax rate is created.

0 Likes 0 ·

And it would be great if the register app could refresh automatically when a tax rate is assigned to an item added to the current order, so we could see the tax value on the field "Tax", above "Total".

0 Likes 0 ·

Welcome to the
Clover Developer Community