Hi. I want to retrieve items list from several sales invoice through this REST API:
curl_init(‘http://icareindo.id/api/resource/Sales%20Invoice?fields=[“name”,“items”]’);
But I got OperationalError: (1054, “Unknown column ‘items’ in ‘field list’”) even though column items is actually in data
I suspect that it is because column items is an array.
How do I get the items list through REST API? Thank you
To get item details you need to call particular invoice.
eg:
http://testrazorpay.erpnext.dev:8000/api/resource/Sales%20Invoice/SINV-00001
Right, the image I showed is from retrieving the data of 1 sales invoice. but how to get more than 1 sales invoice? And for certain field list only? (e.g. name, items, and due_date)
You need two requests for this
- To get list all Sales Invoices,
http://testrazorpay.erpnext.dev:8000/api/resource/Sales%20Invoice
- From above list, pull details for individual Sales Invoice
http://testrazorpay.erpnext.dev:8000/api/resource/Sales%20Invoice/SINV-00001
I see… So there is no other alternative then. Thanks Saurabh6790