Categories

Staff have access to the get, list and create API calls listed below if the Expenses tab is enabled for staff. Staff cannot delete or update Categories.

The Categories API provides access to the Expense Categories in the application. They relate to the category_id field as used in the Expenses API.


category.svc/create

Create a new category/ If successful, returns the category_id of the newly created item.

Request

POST https://secure.salengo.com/api/catalog/create

Input

  • Type
  • Name
  • Description
  • CategoryName
  • Price
  • Currency
  • Quantity
  • Unit
  • isTaxable
  • VAT
  • IsInventory
  • StockQuantity
  • Barcode
  • isExpense

Response

Status: 200 OK "True"

category.svc/update

Update an existing expense category with the given category_id. Any category fields left out of the request will remain unchanged.
catalogy_id refers to catalog's name.

Request

PUT https://secure.salengo.com/api/catalog.svc/update/:id

Input

Check list under catalog/create .

Response

Status: 200 OK "True"

category.svc/get

Return the complete category details associated with the given category_id.

Request

GET https://secure.salengo.com/api/catalog.svc/get/:id

Response

{ "Name": "APPIPOD16C", "Description": "Apple iPod Touch 16 Go Blanc", "CategoryName": "", "Price": 205.45, "Currency": "EUR", "Quantity": 1, "Unit": 1, "VAT": 19.6, "StockQuantity": 14, "Barcode": "", "isExpense": false }

category.svc/delete

Delete an existing expense category/

Request

DELETE https://secure.salengo.com/api/catalog.svc/delete/:id

Response

Status: 200 OK "true"

category.svc/list

Returns a list of expense categories.

Note: This method uses pagination.

Request

GET https://secure.salengo.com/api/catalog.svc/list

Response

Status: 200 OK [ { "Name": "APPIPOD16A", "Description": "Apple iPod Touch 16 Go Blanc", "CategoryName": "", "Price": 205.45, "Currency": "EUR", "Quantity": 1, "Unit": 1, "VAT": 19.6, "StockQuantity": 14, "Barcode": "", "isExpense": false }, { "Name": "APPIPOD16B", "Description": "Apple iPod Touch 16 Go Blanc", "CategoryName": "", "Price": 205.45, "Currency": "EUR", "Quantity": 1, "Unit": 1, "VAT": 19.6, "isInventory": true, "StockQuantity": 14, "Barcode": "", "isExpense": false }, ... ]

>>> A filter of categories and subcategories can be requested using body element.

Request

POST https://secure.salengo.com/api/catalog.svc/list

Filter

  • Type
  • Name
  • Description
  • Price_Low
  • Price_High
  • Quantity_Low
  • Quantity_High
  • Stock_Low
  • Stock_High
  • VAT
  • Inventory_Checked
Response Status: 200 OK [ { "Name": "APPIPOD16A", "Description": "Apple iPod Touch 16 Go Blanc", "CategoryName": "", "Price": 205.45, "Currency": "EUR", "Quantity": 1, "Unit": 1, "VAT": 19.6, "StockQuantity": 14, "Barcode": "", "isExpense": false }, { "Name": "APPIPOD16B", "Description": "Apple iPod Touch 16 Go Blanc", "CategoryName": "", "Price": 205.45, "Currency": "EUR", "Quantity": 1, "Unit": 1, "VAT": 19.6, "isInventory": true, "StockQuantity": 14, "Barcode": "", "isExpense": false }, ... ]