Products

This s a documentation page for our shiny new REST API - you weren't meant to find it. This API isn't ready for public use yet. We're chopping and changing it a LOT as we grow it. So if you build something that uses it then it's very likely to break in a future update. Don't say you weren't warned!

URL:

https://api.kashflow.com/v2/products

Method(s):

Get, Post

Response Formats:

JSON, XML

Description:

Returns a paginated list of products by nominal code, creates product

Parameters

NameTypeDescription
IdNumericUnique product id
CodeStringUnique product code
NominalCodeStringCode of the parent nominal for this product
NominalIdNumericUnique id of the nominal
NameStringProduct name
DescriptionStringProduct description
AutoFillLineItemBooleanIf true, then when the user selects this code they expect other form fields to be pre-filled with the information
PriceNumericAuto-fill price value of the product
WholeSalePriceNumericIf the customer for which the invoice is being created has wholesale pricing enabled then this price should be used for pre-filling form fields instead of the value in Price
VATRateNumericAuto-fill Vat rate of the product
ManageStockLevelBooleanIf true then the user wished to manage stock levels for this product
QuantityInStockNumericIndicates the quantity in stock. This is automatically decreased when lines of this item are added to a sales invoice
StockWarningQuantityNumericThis is the warning threshold for the nominal code. The user wishes to be alerted if the quantity drops below this level
IsDefaultBooleanIndicates if the product is the default one to display
InUseBooleanIndicates if product is in use and to be displayed in product list
PurchaseNominalIdNumericThe figure held for the Qty in Stock will be automatically incremented when the nominal code indicated is purchased
PurchaseSubNominalIdNumericIf present then only purchases matching both the nominal code above AND this product code will result in the stock levels being automatically incremented

GET Operation

Returns a paginated list of products. To GET list of products-

URL : /v2/nominals/{nominalcode}/products?page={page}&perpage={perpage}&sortcolumn={sortcolumn}&order={order}&filterbycharacter={filterbycharacter}&filterbyinuseonly={filterbyinuseonly}

A paginated list of products is returned (ordered by product id in ascending order).

Example response for GET of product list


{
    "Data": [{
        "AutoFillLineItem": true,
        "Code": "AV201ACI",
        "Description": "AV201ACI ACDC Black ice white L",
        "InUse": true,
        "IsDefault": false,
        "ManageStockLevel": true,
        "Name": "AV201ACI ACDC Black ice white L",
        "NominalCode": 4914,
        "Price": 13.85,
        "PurchaseNominalId": 0,
        "PurchaseSubNominalId": 0,
        "QuantityInStock": 9,
        "StockWarningQuantity": 10,
        "VATExempt": false,
        "VATRate": 0.0000,
        "WholeSalePrice": 0.0000
    }, {
        "AutoFillLineItem": true,
        "Code": "AV201ACI",
        "Description": "AV201ACI ACDC Black ice white XL",
        "InUse": true,
        "IsDefault": false,
        "ManageStockLevel": true,
        "Name": "AV201ACI ACDC Black ice white XL",
        "NominalCode": 4914,
        "Price": 13.85,
        "PurchaseNominalId": 0,
        "PurchaseSubNominalId": 0,
        "QuantityInStock": 9,
        "StockWarningQuantity": 10,
        "VATExempt": false,
        "VATRate": 0.0000,
        "WholeSalePrice": 0.0000
    }, {
        "AutoFillLineItem": true,
        "Code": "AV201CHI",
        "Description": "AV201CHI CHILLI PEPPERS WHITE S",
        "InUse": true,
        "IsDefault": false,
        "ManageStockLevel": true,
        "Name": "AV201CHI CHILLI PEPPERS WHITE S",
        "NominalCode": 4914,
        "Price": 13.85,
        "PurchaseNominalId": 0,
        "PurchaseSubNominalId": 0,
        "QuantityInStock": 9,
        "StockWarningQuantity": 10,
        "VATExempt": false,
        "VATRate": 0.0000,
        "WholeSalePrice": 0.0000
    }, {
        "AutoFillLineItem": true,
        "Code": "AV201CHI",
        "Description": "AV201CHI CHILLI PEPPERS WHITE M",
        "InUse": true,
        "IsDefault": false,
        "ManageStockLevel": true,
        "Name": "AV201CHI CHILLI PEPPERS WHITE M",
        "NominalCode": 4914,
        "Price": 13.85,
        "PurchaseNominalId": 0,
        "PurchaseSubNominalId": 0,
        "QuantityInStock": 9,
        "StockWarningQuantity": 10,
        "VATExempt": false,
        "VATRate": 0.0000,
        "WholeSalePrice": 0.0000
    }, {
        "AutoFillLineItem": true,
        "Code": "AV201CHI",
        "Description": "AV201CHI CHILLI PEPPERS WHITE L",
        "InUse": true,
        "IsDefault": false,
        "ManageStockLevel": true,
        "Name": "AV201CHI CHILLI PEPPERS WHITE L",
        "NominalCode": 4914,
        "Price": 13.85,
        "PurchaseNominalId": 0,
        "PurchaseSubNominalId": 0,
        "QuantityInStock": 9,
        "StockWarningQuantity": 10,
        "VATExempt": false,
        "VATRate": 0.0000,
        "WholeSalePrice": 0.0000
    }],
    "MetaData": {
        "FirstPageUrl": "http:\/\/securedwebapp.com\/RestApi\/\/nominals\/4914\/products?page=1&perpage=5&sortby=ProductCode&order=Asc",
        "LastPageUrl": "http:\/\/securedwebapp.com\/RestApi\/\/nominals\/4914\/products?page=66&perpage=5&sortby=ProductCode&order=Asc",
        "NextPageUrl": "http:\/\/securedwebapp.com\/RestApi\/\/nominals\/4914\/products?page=4&perpage=5&sortby=ProductCode&order=Asc",
        "PreviousPageUrl": "http:\/\/securedwebapp.com\/RestApi\/\/nominals\/4914\/products?page=2&perpage=5&sortby=ProductCode&order=Asc",
        "TotalRecords": 330
    }
}

Request Parameters

NameDescription
pageThe product page number
perpageNumber of records to be fetched
sortbyIndex of the column on which sorting needs to be applied. The acceptable values for this parameter are:
1. ProductCode
2. ProductName
3. NominalCode
orderSort direction can be either Asc for ascending or Desc for descending.
filterbycharacterFilter product list that starts with given filter characters in product name.
filterbyinuseonlyTrue fetches only products which are in use. False fetches products which are in use as well as not in use

POST Operation


Product can be created by supplying Code, Name and NominalCode (of product’s parent)
Creates a new product record with the given data using following URL –

URL : /v2/products

Example request for POST of product.


//Any other property than the 3 mentioned in below request will be ignored and defaulted to what is in response.
    {
        "Code": "AV201CHI",
        "Name": "CHILLI PEPPERS WHITE LARGE",
        "NominalCode": 4914
    }

Example response for POST of product


{
        "AutoFillLineItem": false,
        "Code": "AV201CHI",
        "Description": "",
        "InUse": true,
        "IsDefault": false,
        "ManageStockLevel": false,
        "Name": "CHILLI PEPPERS WHITE LARGE",
        "NominalCode": 4914,
        "Price": 0,
        "PurchaseNominalId": 0,
        "PurchaseSubNominalId": 0,
        "QuantityInStock": 0,
        "StockWarningQuantity": 0,
        "VATExempt": false,
        "VATRate": 0.0000,
        "WholeSalePrice": 0.0000
}

See how IRIS KashFlow works with your business and your books