Browse Documentation
POST Update item

Update Item

PUT /items/:id

You can use a PUT or POST request to update an existing item.

Only parameters that are part of the request will be updated. All parameters that are not part of the update request will be left unchanged. To remove default GL accounts or tax rate you explicitly need to set a null value for those parameters as part of your request.

NOTE: The tracked property below is optional and if set to true, the gl_account_purchases_id and gl_account_inventory_asset_id must be provided. See  Create Item Endpoint for more information.

Request

     
curl - s - H "Content-Type: application/json" - H "Authorization: Bearer token"\ -
XPUT\ -
d '{
    "item": {
        "title": "item name",
        "description": "item description",
        "sales_price": "250.00",
        "purchase_price": "200.00",
        "item_category_id":"44d6fd2d06bb9f921d4abd8956779d62a31a6233",
        "sale_tax_id": "fd62ee6c1d65e4729da41f85cdd328dfc816d161",
        "purchase_tax_id": "81807769a53a85cbf3b4a8d2bcbd2b73ec23f9bf",
        "show_purchases": true,
        "show_invoices": true,
        "tracked": true,
        "gl_account_inventory_asset_id": "27f1826332f9ac48a21f362bc7cf16b874f1dd34",
        "gl_account_sales_id":"aefb526889e1059a61ecce700a3363c388a93335"
        "gl_account_cost_of_goods_sold_id": "78f1826332f9ac48a21f362bc7cf16b874f1d45",
        "reorder_point" : 10

    }
}
' \
https://app.accounteer.com/api/v0.1/items/
      

Response

{
    "id": "6eb9c5226ebbe24929da385b02122c0274b239d1",
    "organization_id": "daa71f0644647c0d82dd2d03d0b29779644b1a48",
    "title": "item name",
    "description": "item description",
    "sales_price": "250.00",
    "purchase_price": "200.00",
    "show_invoices": true,
    "show_purchases": true,
    "reorder_point": 10,
    "tracked":true
    "tax": {
        "id": "fd62ee6c1d65e4729da41f85cdd328dfc816d161",
        "name": "VAT 21%",
        "percentage": "21.00"
    },
    "account_invoice": null,
    "gl_account_sale": {
        "id": "aefb526889e1059a61ecce700a3363c388a93335",
        "code": "611000",
        "title": "Sales",
        "description": null
    },
    "gl_account_inventory_asset_id": {
        "id": "27f1826332f9ac48a21f362bc7cf16b874f1dd34",
        "code": "56000",
        "title": "Inventory Asset",
        "description": null
    },
    ,
    "gl_account_cost_of_goods_sold_id": {
        "id": "78f1826332f9ac48a21f362bc7cf16b874f1d45",
        "code": "78000",
        "title": "Cost of goods Sold",
        "description": null
    },
    "sales_tax": {
        "id": "fd62ee6c1d65e4729da41f85cdd328dfc816d161",
        "name": "VAT 21%",
        "percentage": "21.00"
    },
    "purchase_tax": {
        "id": "81807769a53a85cbf3b4a8d2bcbd2b73ec23f9bf",
        "name": "VAT 6%",
        "percentage": "6.00"
    },
    "item_category_id": {
        "id": "44d6fd2d06bb9f921d4abd8956779d62a31a6233",
        "title": "item name 2"
    },
    "images":[  
         {  
            "id":"f53fa136c53657367d73add5788faf818483fc28",
            "file_url":"https://f.accounteer.com/f53fa136c53657367d73add5788faf818483fc28/63563de3116                        06b6528fdf949b7c9128afba414d3/test.png",
            "file_name":"test.png",
            "date_created":"2018-02-22"
         },
         {  
            "id":"16df7928c8c04f1e0442dc2c7931d9fed7e17bf7",
            "file_url":"https://f.accounteer.com/16df7928c8c04f1e0442dc2c7931d9fed7e17bf7/63563de3116                        06b6528fdf949b7c9128afba414d3/test.png",
            "file_name":"test.png",
            "date_created":"2018-02-22"
         },
    "date_created": "2017-07-23",
    "date_updated": "2017-07-23"
}