Loading…
Loading…
The routes and parameters are the ones in Frappe’s own API code, for both API versions.
Fields
Filters
GET https://erp.yourcompany.com/api/resource/Sales%20Invoice?fields=%5B%22name%22%2C%22customer%22%2C%22grand_total%22%2C%22status%22%5D&filters=%5B%5B%22status%22%2C%22%3D%22%2C%22Unpaid%22%5D%5D&order_by=posting_date%20desc&limit_page_length=20
curl -X GET 'https://erp.yourcompany.com/api/resource/Sales%20Invoice?fields=%5B%22name%22%2C%22customer%22%2C%22grand_total%22%2C%22status%22%5D&filters=%5B%5B%22status%22%2C%22%3D%22%2C%22Unpaid%22%5D%5D&order_by=posting_date%20desc&limit_page_length=20' \ -H 'Authorization: token API_KEY:API_SECRET'
The reply comes back as { "data": … }.
A list of rows with the fields you asked for; limit 0 returns every row.
Get a key and secret
Open the User the integration will act as, and under API Access press Generate Keys. The secret is shown once.
Use a dedicated user
Give the integration its own user with only the roles it needs; every call runs with that user’s permissions.
Keep the secret on a server
Call the API from your server or integration tool, never from code that runs in a visitor’s browser.
Generate an API key and secret for a user (User › API Access › Generate Keys) and send them as “Authorization: token key:secret”. Each request runs with that user’s permissions.
v1 lives at /api/resource, v2 at /api/v2/document. They do the same jobs; v2 updates with PATCH and its list call takes start and limit and tells you if there is a next page.
20 unless you ask for more. On v1, limit_page_length=0 returns every row.
Send filters as a JSON list of [field, operator, value], for example [["status","=","Unpaid"]]. Operators include =, !=, >, <, like and in.
Not with a key and secret — anyone could read them. Call it from your server or an integration tool.
We design the integration, set up API users with the right permissions, and build and monitor the connection. Talk to a consultant.
or write to info@acube.co
Kochi (Kadavanthra & Infopark) · Thiruvananthapuram · across India & overseas · In business since 2011