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
| Name | Type | Description |
|---|---|---|
| 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 -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"}' result = client.call("erpnext", "create_customer", {"customer_name":"customer name"}) const result = await cotlet.call('erpnext', 'create_customer', {"customer_name":"customer name"}); cotlet call erpnext create_customer --data '{"customer_name":"customer name"}' Example response
{
"customer": "Harbor & Pine",
"customer_name": "Harbor & Pine",
"customer_type": "Company",
"customer_group": "Commercial",
"territory": "United States",
"created": true
}