Stock Items

Minimum access level: Tax and Limited Accounting

Provides read-only access to the list of stock items defined in the FreeAgent account.

Attributes

Attribute Description Kind
url The unique identifier for the stock item URI
description Free-text description / code to identify the item when it's added to an invoice or estimate String
opening_quantity Stock on hand as of FreeAgent Start Date Integer
opening_balance The value of stock on hand as of FreeAgent Start Date Decimal
cost_of_sale_category The spending category which will be used to account for sales of this stock item URI
stock_on_hand Stock on hand as of today Integer

List all Stock Items

GET https://api.freeagent.com/v2/stock_items

Response

Status: 200 OK
{
  "stock_items": [
    {
      "url": "https://api.freeagent.com/v2/stock_items/3",
      "description": "Apple",
      "opening_quantity": "10.0",
      "opening_balance": "1.0",
      "cost_of_sale_category": "https://api.freeagent.com/v2/categories/2",
      "stock_on_hand": "10.0"
    }
  ]
}
Show as XML
<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <stock-items type="array">
    <stock-item>
      <url>https://api.freeagent.com/v2/stock_items/3</url>
      <description>Apple</description>
      <opening-quantity type="decimal">10.0</opening-quantity>
      <opening-balance type="decimal">1.0</opening-balance>
      <cost-of-sale-category>https://api.freeagent.com/v2/categories/2</cost-of-sale-category>
      <stock-on-hand type="decimal">10.0</stock-on-hand>
    </stock-item>
  </stock-items>
</freeagent>
Show as JSON

Get a single Stock Item

GET https://api.freeagent.com/v2/stock_items/:id

Response

Status: 200 OK
{
  "stock_item": {
    "url": "https://api.freeagent.com/v2/stock_items/3",
    "description": "Apple",
    "opening_quantity": "10.0",
    "opening_balance": "1.0",
    "cost_of_sale_category": "https://api.freeagent.com/v2/categories/2",
    "stock_on_hand": "10.0"
  }
}
Show as XML
<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <stock-item>
    <url>https://api.freeagent.com/v2/stock_items/3</url>
    <description>Apple</description>
    <opening-quantity type="decimal">10.0</opening-quantity>
    <opening-balance type="decimal">1.0</opening-balance>
    <cost-of-sale-category>https://api.freeagent.com/v2/categories/2</cost-of-sale-category>
    <stock-on-hand type="decimal">10.0</stock-on-hand>
  </stock-item>
</freeagent>
Show as JSON