Stock Module API
The Stock module provides APIs for inventory management, stock movements, item details, and warehouse operations.Item Details APIs
get_item_details
Retrieve comprehensive item details including pricing, stock levels, tax templates, and warehouse information.Item code/ID
Warehouse for stock information
Document type (e.g., “Sales Order”, “Purchase Order”, “Delivery Note”)
Company name
Customer name for customer-specific pricing
Supplier name for supplier-specific details
Quantity for pricing calculations
Price list for selling transactions
Price list for buying transactions
Comprehensive item information
Response Properties
Response Properties
item_code: Item codeitem_name: Item namedescription: Item descriptionstock_uom: Stock unit of measureprice_list_rate: Rate from price listdiscount_percentage: Applicable discountrate: Final rate after discountamount: Total amount (qty × rate)actual_qty: Available quantity in warehouseprojected_qty: Projected quantitywarehouse: Default warehouseitem_tax_template: Tax templateitem_tax_rate: Tax rates as JSONhas_serial_no: Whether item has serial numbershas_batch_no: Whether item has batch numbersconversion_factor: UOM conversion factor
Stock Balance APIs
get_stock_balance
Get current stock balance for an item in a warehouse.Item code
Warehouse name
Date for balance calculation
Time for balance calculation
Include valuation rate in response
Stock quantity, or tuple of (quantity, valuation_rate) if with_valuation_rate=True
get_stock_value_on
Get total stock value for warehouses on a specific date.List of warehouse names
Date for valuation
Filter by specific item
Filter by company
Total stock value
Stock Entry APIs
make_stock_entry
Create a stock entry for material movements.Item code
Source warehouse
Target warehouse
Quantity to transfer
Purpose: “Material Issue”, “Material Receipt”, “Material Transfer”, “Material Transfer for Manufacture”, “Manufacture”, “Repack”
Item rate (auto-calculated if not provided)
Company name
Return doc without saving
Save but don’t submit
Stock Entry document
Barcode & Serial Number APIs
scan_barcode
Scan barcode and retrieve item, serial number, batch, or warehouse information.Barcode, serial number, batch number, or warehouse to scan
Context with company and doctype information
Scanned entity information
Possible Response Types
Possible Response Types
Barcode Match:
barcode: Barcode valueitem_code: Associated itemuom: Unit of measure
serial_no: Serial numberitem_code: Associated itembatch_no: Batch if applicable
batch_no: Batch numberitem_code: Associated item
warehouse: Warehouse name
Valuation APIs
get_incoming_rate
Get incoming rate for an item based on valuation method (FIFO/LIFO/Moving Average).Item code
Warehouse name
Transaction date
Quantity
Company name
Incoming/valuation rate
get_valuation_method
Get valuation method for an item.Item code
Company name
Valuation method: “FIFO”, “LIFO”, or “Moving Average”
Warehouse APIs
validate_warehouse_company
Validate that warehouse belongs to the specified company.Warehouse name
Company name
Raises exception if validation fails