question

foggyfrog avatar image
foggyfrog asked David Marginian Deactivated commented

POST man does not update quantity while create a new item

I'm trying to create Item with available quantity.item was created successful but quantity stay as 0.

POSTMAN link

https://api.clover.com/v3/merchants/HCHW6CEMFT2W1/items


JSON OBJECT

{
   "name":"aruna test1",
   "alternateName":"aruna alternate name",
   "code":"123456",
   "price":"999",
   "itemStock":{"quantity":"10"},
   "priceType":"FIXED",
   "hidden":false,
   "available":true,
   "autoManage":false,
   "defaultTaxRates":true,
   "isRevenue":true,
   "taxRates":[
      {
         "name":"Sales Tax"
      }
   ]
}


RESPONSE

{
   "id":"1PF2BDFTJD4JJ",
   "hidden":false,
   "available":true,
   "autoManage":false,
   "name":"aruna test1",
   "alternateName":"aruna alternate name",
   "code":"123456",
   "price":999,
   "priceType":"FIXED",
   "defaultTaxRates":true,
   "isRevenue":true,
   "modifiedTime":1639335447000
}


can someone please explain me what i'm doing wrong here ..?


Inventory
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

·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

Our API docs are misleading for most post requests (we have a single request/response object and the docs reflect attributes that aren't acted upon). Please use https://docs.clover.com/reference/inventoryupdateitemstock-1 to update item stock.

4 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.

foggyfrog avatar image foggyfrog commented ·

so same case for the tax rates also. I want to use multiple tax rates for some items. when i put

default tax to false and send taxRates object like below tax rates also not updating.how can i update that.


{
   "name":"aruna test1",
   "alternateName":"aruna alternate name",
   "code":"123456",
   "price":"999",
   "itemStock":{"quantity":"10"},
   "priceType":"FIXED",
   "hidden":false,
   "available":true,
   "autoManage":false,
   "defaultTaxRates":true,
   "isRevenue":true,
   "taxRates":[
      {
         "name":"Sales Tax"
      }
   ]
}
0 Likes 0 ·
foggyfrog avatar image foggyfrog David Marginian ♦♦ commented ·

ACTUALLY I'm not trying to create new tax rates. i want to assign multiple tax rates for item and create new item.this how my JSON looks like.item is created but tax rates are not updated.what is the correct format to create item with multiple tax rates ..?

{
    "name": "Aruna Test 54",
    "alternateName": "",
    "code": "1234",
    "price": "4000",
    "itemStock": {
        "quantity": "78"
    },
    "priceType": "FIXED",
    "hidden": false,
    "available": true,
    "autoManage": false,
    "defaultTaxRates": false,
    "isRevenue": true,
    "taxRates": [
        {
            "id": "NCKDMJ8RJ6QSY",
            "name": "Sales Tax",
            "rate": 600000,
            "isDefault": true
        },
        {
            "id": "QRCR0XFEDGAX0",
            "name": "60Ml Juice Tax",
            "rate": 0,
            "isDefault": false,
            "taxAmount": 396
        },
        {
            "id": "R0PBVSDB3N3X4",
            "name": "30Ml Juice Tax",
            "rate": 0,
            "isDefault": false,
            "taxAmount": 198
        },
        {
            "id": "QRCR0XFEDGAX0",
            "name": "60Ml Juice Tax",
            "rate": 0,
            "isDefault": false,
            "taxAmount": 396
        },
        {
            "id": "R0PBVSDB3N3X4",
            "name": "30Ml Juice Tax",
            "rate": 0,
            "isDefault": false,
            "taxAmount": 198
        }
    ]
   
}
0 Likes 0 ·
Show more comments

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