Create customer

Creates a customer with type, group and territory.

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

write

Creates a Customer and returns its ID. ERPNext asks for the Customer Name, Customer Type, Customer Group and Territory on the form; pass the ones your site needs, and the call returns ERPNext's own error if a required one is missing. Address and contact are added in ERPNext under Address & Contact. It reaches no one and can be deleted again, so it does not ask for confirmation.

Parameters

Parameters: create_customer
NameTypeDescription
customer_name string required string Customer Name as it should appear on invoices.
customer_type string string Company, Individual or Partnership.
customer_group string string Customer Group name from your site.
territory string string Territory name from your site.
billing_currency string string Currency code, for example USD. Sets the default currency of new documents.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/erpnext/customers \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customer_name":"customer name"}'
Python
result = client.call("erpnext", "create_customer", {"customer_name":"customer name"})
Node.js
const result = await cotlet.call('erpnext', 'create_customer', {"customer_name":"customer name"});
CLI
cotlet call erpnext create_customer --data '{"customer_name":"customer name"}'

Example response

JSON

{
  "customer": "Harbor & Pine",
  "customer_name": "Harbor & Pine",
  "customer_type": "Company",
  "customer_group": "Commercial",
  "territory": "United States",
  "created": true
}

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.