Add Product

A sale transaction to a customer can only be recorded with Sale of Stock or non-stock product.

Business Rules

The followings fields are required for both stock and non-stock products

•	Product Type
•	Product Name
•	Product Code
•	Income Account Code
•	Expense Account Code
•	Tax Schedule

For the stock products following additional fields are also required.

•	Stock Account Code
•	Date 
•	Opening Quantity
•	Opening Rate

Single Product per API call.

The Product Object
ApiToken

String

*(Required)

API authorisation token obtained via authentication API.

Type

Enum

*(Required)

Type of the Product from 'stock' or 'nonstock'

Name

String (200)

*(Required)

Name of the Product or Service.

Code

String (40)

*(Required)

This must be a unique number. In case Auto Product Code is enabled, simply send a number. System will allocate an Auto Number and returns it in the success response.

CategoryName

String (200)

(Optional)

Name of the category. In case this is not added previously, a new category will be added.

Date

Date (YYYY-MM-DD)

(Optional)

Date for the opening stock, this is required when type is stock.

OpeningQty

decimal (20, 6)

(Optional)

this is required when a stock product is added, if no opening stock send 0 as Opening stock

OpeningRate

decimal (20, 6)

(Optional)

Rate for the opening stock calculation. This is single product rate.

LowStockLevel

decimal (20, 6)

(Optional)

Low stock level of the product

SalePrice

decimal (20, 6)

(Optional)

Sale Price on which goods and services are sold.

Cost

decimal (20, 6)

(Optional)

Purchase cost of goods and services.

SaleInformation

String (1000)

Descriptive information about the product.

IncomeAccountCode

String (100)

*(Required)

Code of Income Nominal Account where Product Income is charged.

StockAccountCode

String (100)

*(Required)

Code of Stock Nominal Account for product type stock only

ExpenseAccountCode

String (100)

*(Required)

Code for the Expense Nominal Account

IsPurchased

Enum

(Optional)

List ('Yes', 'No')

TPSale

decimal (20, 6)

(Optional)

Sale Trade Price of the Product

TPPurchase

decimal (20, 6)

(Optional)

Purchase Trade Price of the Product

Weight

decimal (20, 6)

(Optional)

Weight of the product.

UnitName

String (200)

(Optional)

Unit of Measurement of the Product. In case of new unit, system will automatically register the Unit.

SaleDiscount

Decimal (2,2)

(Optional)

Sale Discount between 0 to 100

PurchaseDiscount

Decimal (2,2)

(Optional)

Purchase Discount between 0 to 100

TaxCode

String (20)

(Optional)

GST Tax Code for the product. For GST Code go to Settings -> Taxes and Year-End

NFTaxCode

String (20)

(Optional)

GST Tax Code for non-filer customer, in case the GST rate is the same for the filer and non-filer customers, add the same GST code as in Tax Code.

RMSale

Decimal (15,2)

(Optional)

Retail Margin Sales

RMPurchase

Decimal (15,2)

(Optional)

Retail Margin Purchase

TOSale

Decimal (15,2)

(Optional)

Trade offer Purchase

TOPurchase

Decimal (15,2)

(Optional)

Trade Offer Sale

TaxSchedule

Integer (1)

*(Required)

Tax schedule for the standard product is 4 and Schedule 3 Product is 3.

PreferredSupplier

String (20)

(Optional)

Supplier Code

BinLocation

String (20)

(Optional)

Bin Location Code data

LargePackSize

String (20)

(Optional)

Large Pack Size

SmallPackSize

String (20)

(Optional)

Small Pack Size

ProductNotes

String (500)

(Optional)

Notes

Field1

String (50)

(Optional)

Extra Fields 1- 4 and Fields A - D are provided to record any information relevant to the product.

Field2

String (50)

(Optional)

As Field1

Field3

String (50)

(Optional)

As Field1

Field4

String (50)

(Optional)

As Field1

FieldA

String (100)

(Optional)

As Field1

FieldB

String (100)

(Optional)

As Field1

FieldC

String (100)

(Optional)

As Field1

FieldD

String (100)

(Optional)

As Field1

Sample Object
{
    "ApiToken": "6fcd41e45626947506089ee7e16d3bd7",
    "Type": "nonstock",
    "Name": "P1003",
    "Code": "P1003",
    "CategoryName": "A",
    "Date": "2022-02-23",
    "OpeningQty": "100",
    "OpeningRate": "50.00",
    "LowStockLevel": "10",
    "SalePrice": "75.00",
    "Cost": "45.00",
    "SaleInformation": "Product P1003",
    "IncomeAccountCode": "Sales of Product Income",
    "StockAccountCode": "Stock",
    "ExpenseAccountCode": "Supplies and materials",
    "IsPurchased": "yes",
    "TPSale": "0",
    "TPPurchase": "0",
    "Weight": "1",
    "UnitName": "Pcs",
    "SaleDiscount": "5",
    "PurchaseDiscount": "10",
    "SalesTaxCode": "GST101",
    "NFSalesTaxCode": "GST102",
    "RMSale": "0.00",
    "RMPurchase": "0.00",
    "TOSale": "0.00",
    "TOPurchase": "0.00",
    "TaxSchedule": "4",
    "PreferredSupplier": "",
    "IsShipping": "0",
    "BinLocation": "",
    "LargePackSize": "",
    "SmallPackSize": "",
    "ProductNotes": "Product P1003",
    "Field1": "F1",
    "Field2": "F2",
    "Field3": "F3",
    "Field4": "F4",
    "FieldA": "FieldA",
    "FieldB": "FieldB",
    "FieldC": "FieldC",
    "FieldD": "FieldD"    
}                  
API URL

https://api.fastaccounts.io/index.php/api/products/add

Sample Response
{"Status":1,"Code":"200","Message":"The request was successfully completed.","ProductCode":"1015"}
Status Codes
Status Code Type Message
200 Success The request was successfully completed.
201 Error Invalid Key Details.
202 Error Data is not valid in API request.
203 Error Data is not valid in API products.
204 Error Validation failed.
205 Error Invalid IP Address.
400 Error Bad Request.
403 Error Forbidden.
404 Error Not Found.
500 Error Internal Server Error.