Hi,
I want to GET sales item’s Quantity with there Batches via Rest API, i can’t find DocType
Thanks
Hi,
I want to GET sales item’s Quantity with there Batches via Rest API, i can’t find DocType
Thanks
Try something like this on your terminal:
BASE_URL="https://erp.my_company.com"
TOKEN=$(echo -n "MY_API_KEY:MY_API_SECRET" | base64 -w 0)
ITEM_CODE="12345"
WAREHOUSE="My Warehouse"
curl --location --request GET "$BASE_URL/api/method/erpnext.stock.utils.get_stock_balance" \
--data-urlencode "item_code=$ITEM_CODE" \
--data-urlencode "warehouse=$WAREHOUSE" \
--header "Authorization: Basic $TOKEN"
This should return something like
{"message":150.0}
Edit: updated to include @revant_one’s solution.
echo -n "apfjxkic-omyuobwd339805ak:60a06cd2ddfad610b9490d359d605407" | base64 -w 0
Thanks,
This helps me
api/method/erpnext.stock.doctype.batch.batch.get_batch_qty?batch=[(batch]&warehouse=[warehouse]