Try ERPNext Buy Support Partners Foundation

ERP NEXT API for stock balance and price list

Is there any api of ERP NEXT which provide information about stock balance and price list of item. I have this link of my erpnext but it doesn’t give information about stock balance and price list. Can you please tell me is there any way to get stock balance information of particular item without coding in ERPNEXT.

1 Like

Hi, you can invoque any whitlisted method from URL. You can try thisone as i think that it’s what you need. Maybe there is a better one, but i did a quick search.

/api/method/erpnext.stock.get_item_details.get_item_details?args={"item_code":"ITEM_CODE","company":"COMPANY_NAME","doctype":"DOCTYPE_NAME", ...}

You should replace the uppercase words with what you need. The DOCTYPE_NAME should be “Sales Invoice” or “Purchase Invoice” depending on what you need.

Other parameters that the method should require you to provide are:

    "item_code": "",
    "warehouse": None,
    "customer": "",
    "conversion_rate": 1.0,
    "selling_price_list": None,
    "buying_price_list": None,
    "price_list": None,
    "price_list_currency": None,
    "plc_conversion_rate": 1.0,
    "doctype": "",
    "name": "",
    "supplier": None,
    "transaction_date": None,
    "conversion_rate": 1.0,
    "is_subcontracted": "Yes" / "No",
    "ignore_pricing_rule": 0/1,
    "project": "",
    "set_warehouse": "",
    "qty": 1,
    "material_request_type": "",
    "update_stock": "",
    "parenttype": "",
    "ignore_party": "",
    "cost_center": "",
    "price_list_uom_dependant": "",
    "income_account": "",
    "expense_account": "",
    "batch_no": "",
    "stock_qty": "",
    "against_sales_order": "",
    "against_sales_invoice": ""

Sorry if some are repeated. And maybe a lot of them are not required for what you need.

Yes this api works but what about item price list like if we want to fetch price list of item so is there any api to get price list. Also is there any option to update price list and stock at erpnext using api.

You can try to find the correct method in the code, look for methods with the @frappe.whitelist() decorator. For the fetch you can try with the frappe.client.get_value, or get_list or maybe just get. For the update you can try frappe.client.set_value. You should look your options in that’s from where i got this methods. There is what you need to provide to eachone too. And if what you want is not there you can look around for the decorator in other files, but probably all what you need is there.

1 Like

can’t you give me api method for price list as you give me for stock items. Also please tell me what api i call so i can update stock on erpnext . Please help i really need this.

Please reply i need this asap

Hello i didn’t get any reply from your side.

Maybe respond to Nahuel_Nso’s sound advice and share whatever pointers you have found or tried?

edit: Forum searches on say ‘get_list item price’ or ‘price list error’ and so on will get you clues and tracebacks that will point the way.