question

jevinkosasih avatar image
jevinkosasih asked jevinkosasih commented

Cannot see inventory items tax rate

I am referring to https://docs.clover.com/reference/inventorycreateitem

I sent a POST request with the following body to the https://sandbox.dev.clover.com/v3/merchants/{mId}/items endpoint

{
  "taxRates": [
    {
      "id": "G4DB1EF691SG8",
    }
  ],
  "code": "72527273070",
  "hidden": "false",
  "available": "true",
  "autoManage": "false",
  "price": 2500,
  "sku": "TSH-LOG",
  "defaultTaxRates": "false",
  "cost": 1000,
  "unitName": "null",
  "priceType": "FIXED",
  "alternateName": "Logo Tee",
  "isRevenue": true,
  "name": "Logo T-Shirt",
  "colorCode": "#ffffffff",
  "itemGroup": {
    "id": "JBBHPG39V4TRT"
  }
}

However if I "GET" the new item and expand it with the "taxRates" query param, it returns an empty taxRate.

{
  "id": "65YBXP3KHY09A",
  "hidden": false,
  "available": true,
  "autoManage": false,
  "name": "Logo T-Shirt",
  "alternateName": "Logo Tee",
  "code": "72527273070",
  "sku": "TSH-LOG",
  "price": 2500,
  "priceType": "FIXED",
  "defaultTaxRates": false,
  "unitName": "null",
  "cost": 1000,
  "isRevenue": true,
  "stockCount": 0,
  "taxRates": {
    "elements": []
  },
  "modifiedTime": 1659734806000,
  "colorCode": "#ffffffff"
}

However this is not the case when I expand "itemGroup"

{
  "id": "65YBXP3KHY09A",
  "hidden": false,
  "available": true,
  "autoManage": false,
  "name": "Logo T-Shirt",
  "alternateName": "Logo Tee",
  "code": "72527273070",
  "sku": "TSH-LOG",
  "price": 2500,
  "priceType": "FIXED",
  "defaultTaxRates": false,
  "unitName": "null",
  "cost": 1000,
  "isRevenue": true,
  "stockCount": 0,
  "itemStock": {
    "item": {
      "id": "65YBXP3KHY09A"
    },
    "stockCount": 1000,
    "quantity": 1000,
    "modifiedTime": 1659048479000
  },
  "modifiedTime": 1659734806000,
  "colorCode": "#ffffffff"
}

Are some body params just not working?

REST APILineItems
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

·
Jonathan Ryan Grice avatar image
Jonathan Ryan Grice answered jevinkosasih commented

Items can be associated with a Tax Rate using the appropriate endpoint

/v3/merchants/{mid}/tax_rates/{taxId}
3 comments
10 |2000

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

jevinkosasih avatar image jevinkosasih commented ·

Thanks, I know that endpoint works. I was just wondering why the https://docs.clover.com/reference/inventorycreateitem endpoint has taxRates as a body param, even though it doesn't work.

0 Likes 0 ·
Jonathan Ryan Grice avatar image Jonathan Ryan Grice jevinkosasih commented ·

You can view item associations, eg. tax_rates, modifiers, etc when you expand the params in a GET call but must be set using the appropriate endpoint. The Tax Rate can not be set when creating an item in one POST.

You have to create the item, then associate it with the tax_rate after the item is created using the taxId and itemId.

0 Likes 0 ·
jevinkosasih avatar image jevinkosasih Jonathan Ryan Grice commented ·
Ah okay got it! Thanks!
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Welcome to the
Clover Developer Community