You can save items for reuse in statements.
EXAMPLE OBJECT
{
"item_category": {
"id": 12,
"name": "My Item",
"description": "This is a sample item",
"unit": "hourly",
"price": "150.00",
"formatted_price": "150.00",
"created_at": "2014-07-21T11:04:58Z"
}
}
Attributes
| Attribute | Description |
|---|---|
| id | integer Item ID |
| name | string Item name, NOTE: When you search saved items to add as line items, you can search by item name or description. |
| description | string Item descripton |
| unit | string |
| price | string |
| formatted_price | string |
DEFINITION
POST https://[subdomain].hiveage.com/api/categories/items
EXAMPLE JSON REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/items\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
-d item_category[name]="My Item" \
-d item_category[description]="This is a sample item" \
-d item_category[price]="150.00" \
-d item_category[unit]="hourly" \
EXAMPLE RESPONSE
{
"item_category": {
"id": 13,
"name": "My Item",
"description": "This is a sample item",
"unit": "hourly",
"price": "150.00",
"formatted_price": "150.00",
"created_at": "2014-07-21T11:04:58Z"
}
}
Attributes
| Parameter | Description |
|---|---|
| name | required Item name, NOTE: When you search saved items to add as line items, you can search by item name or description. |
| description | optional Item descripton |
| unit | optional Item unit |
| price | required |
Return
Returns the item object.
Retrieve an item object with a specified id.
DEFINITION
GET https://[subdomain].hiveage.com/api/categories/items/[id]
EXAMPLE JSON REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/items/[id]\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
EXAMPLE RESPONSE
{
"item_category": {
"id": 13,
"name": "My Item",
"description": "This is a sample item",
"unit": "hourly",
"price": "150.00",
"formatted_price": "150.00",
"created_at": "2014-07-21T11:04:58Z"
}
}
Arguments
| Parameter | Description |
|---|---|
| id | required The id of the item object. |
Returns
Returns an item JSON object if a valid item category id was specified. Returns an error otherwise.
Update a saved item.
DEFINITION
PUT https://[subdomain].hiveage.com/api/categories/items/[id]
EXAMPLE JSON REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/items/[id]\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
-d item_category[name]="My Item" \
-d item_category[price]="200.00" \
EXAMPLE RESPONSE
{
"item_category": {
"id": 13,
"name": "My Item",
"description": "This is a sample item",
"unit": "hourly",
"price": "200.00",
"formatted_price": "200.00",
"created_at": "2014-07-21T11:04:58Z"
}
}
Arguments
| Arguments | Description |
|---|---|
| name | required Item name, NOTE: When you search saved items to add as line items, you can search by item name or description. |
| description | optional Item descripton |
| unit | optional Item unit |
| price | required |
Returns
Returns an item JSON object if a valid item category id was specified. Returns an error otherwise.
Deleting an item object permanently.
DEFINITION
DELETE https://[subdomain].hiveage.com/api/categories/items/[id]
EXAMPLE REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/items/[id]\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
SAMPLE JSON RESPONSE
{
"item_category": {
"deleted": true,
"id": "13"
}
}
Arguments
| Parameter | Description |
|---|---|
| id | required The id of the item to be deleted. |
Returns an object with a deleted parameter on success.
Returns a list of items. The items are returned sorted alphabetically.
DEFINITION
GET https://[subdomain].hiveage.com/api/categories/items
EXAMPLE REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/items\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
SAMPLE JSON RESPONSE
{
"item_categories": [{
"id": 13,
"name": "My Item",
"description": "This is a sample item",
"unit": "hourly",
"price": "200.00",
"formatted_price": "200.00",
"created_at": "2014-07-21T11:04:58Z"
}
{...},
{...}]
}
The results will be paginated. You can use the following optional parameters to traverse the results.
Arguments
| Parameter | Description |
|---|---|
| per_page | optional Number of results per page (default: 20). Available per page: 20, 60 and 100. |
| page | optional Page in the results set |
| order | optional The list is ordered by name, and can be ordered by desc or asc. The defaul value is asc. |