List customers

Customers with type, group and territory, filtered by name.

GET https://cotlet.dev/api/v1/erpnext/customers

read

Returns customers in the order ERPNext lists them. Use the customer ID from each item in create_sales_invoice, list_sales_invoices and create_payment_entry. The search matches part of the Customer Name. Pages hold up to 100 customers; pass next_cursor back as cursor for the next page.

Parameters

Parameters: list_customers
NameTypeDescription
search string string Part of the Customer Name.
customer_group string string Customer Group name from your site.
territory string string Territory name from your site.
limit integer integer Records per page. Default: 20.
cursor string string Next page cursor from the previous call.

Request

cURL
curl https://cotlet.dev/api/v1/erpnext/customers \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("erpnext", "list_customers")
Node.js
const result = await cotlet.call('erpnext', 'list_customers');
CLI
cotlet call erpnext list_customers

Example response

JSON

{
  "customers": [
    {
      "customer": "Northwind Studio",
      "customer_name": "Northwind Studio",
      "customer_type": "Company",
      "customer_group": "Commercial",
      "territory": "United States"
    },
    {
      "customer": "Lumen Dental",
      "customer_name": "Lumen Dental",
      "customer_type": "Company",
      "customer_group": "Commercial",
      "territory": "United States"
    }
  ],
  "next_cursor": null
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.