Represents a company that buys your products, for example a retailer, a distributor, or an industrial customer. In the Excel templates, customers are registered on the Customers sheet.
Customers are referenced, for example, by customer complaints.
Customers are a shared entity. They work the same way in every manufacturing domain model.
The Customer object
{
"code": "CUST-001",
"name": "Northline Retail",
"taxNumber": "SI87654321",
"group": "CG-RETAIL"
}
Fields
| Field | Type | Description | Example |
|---|---|---|---|
code |
string | Unique business code used to identify the customer in external systems and integrations. | "CUST-001" |
name |
string | Registered or human-readable name of the customer. | "Northline Retail" |
taxNumber |
string or null | Tax number used to identify the customer across source systems. | "SI87654321" |
group |
string or null | Business code of the customer group this customer belongs to. | "CG-RETAIL" |
Important
code must be unique. Two customers cannot use the same code.
Customer groups
A customer group is registered as a customer of its own, with a code and a name. Other customers refer to it through their group field.
For example, register the group first:
{
"code": "CG-RETAIL",
"name": "Retail customers"
}
Then assign customers to it, as in the object above.
- The group must exist before a customer refers to it. Otherwise the request is refused.
- A group can itself belong to a group. A chain of groups that leads back to itself is refused.
- A group cannot be deleted while customers belong to it.
API resource
| Resource | Base path |
|---|---|
Customer |
/manufacturing/v1/customers |
For the operations shared by all shared entities, see Shared entities API.
API methods
Create a customer
POST /manufacturing/v1/customers/insert
Creates a new customer and returns its Pulse identifier.
Request
POST /manufacturing/v1/customers/insert
Content-Type: application/json
{
"code": "CUST-001",
"name": "Northline Retail",
"taxNumber": "SI87654321",
"group": "CG-RETAIL"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
string | yes | Unique business code of the customer. |
name |
string | yes | Registered or human-readable name of the customer. |
taxNumber |
string or null | no | Tax number of the customer. |
group |
string or null | no | Business code of an existing customer group. |
Update a customer
PUT /manufacturing/v1/customers/update
Updates an existing customer. The customer must already exist.
An update replaces all fields. If you leave out taxNumber or group, the customer's tax number or group is removed. To change only some fields, use patch.
Request
PUT /manufacturing/v1/customers/update
Content-Type: application/json
{
"code": "CUST-001",
"name": "Northline Retail Group",
"taxNumber": "SI87654321",
"group": "CG-RETAIL"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
string | yes | Business code of the customer to update. |
name |
string | yes | Registered or human-readable name of the customer. |
taxNumber |
string or null | no | Tax number of the customer. |
group |
string or null | no | Business code of an existing customer group. |
Patch a customer
PATCH /manufacturing/v1/customers/patch
Partially updates an existing customer.
The fields to update are supplied in the properties object. The customer is identified by its business code, which cannot be changed. Fields you leave out keep their current values. To remove the tax number or the group, send it as null.
Request
PATCH /manufacturing/v1/customers/patch
Content-Type: application/json
{
"properties": {
"code": "CUST-001",
"group": null
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
properties |
object | yes | Fields included in the partial update. |
properties.code |
string | yes | Business code of the customer to update. |
properties.name |
string | no | New name of the customer. |
properties.taxNumber |
string or null | no | New tax number, or null to remove it. |
properties.group |
string or null | no | Business code of an existing customer group, or null to remove the group. |
Retrieve a customer
GET /manufacturing/v1/customers/select
Returns the customer identified by its business code. If no customer has this code, the response is empty.
Request
GET /manufacturing/v1/customers/select?id=CUST-001
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | yes | Business code of the customer to retrieve. |
Example response
{
"code": "CUST-001",
"name": "Northline Retail",
"taxNumber": "SI87654321",
"group": "CG-RETAIL"
}
List customers
GET /manufacturing/v1/customers/query
Returns customers matching the supplied filters.
Request
GET /manufacturing/v1/customers/query?groups=CG-RETAIL
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
codes |
string or array of strings | no | Limits results to customers with the specified business codes. |
names |
string or array of strings | no | Limits results to customers with the specified names. Upper and lower case are not distinguished. |
taxNumbers |
string or array of strings | no | Limits results to customers with the specified tax numbers. Upper and lower case are not distinguished. |
groups |
string or array of strings | no | Limits results to customers that belong directly to the specified groups. |
Example response
[
{
"code": "CUST-001",
"name": "Northline Retail",
"taxNumber": "SI87654321",
"group": "CG-RETAIL"
}
]
Delete a customer
DELETE /manufacturing/v1/customers/delete
Deletes the customer identified by its business code. If no customer has this code, nothing happens. A customer group cannot be deleted while customers belong to it.
Request
DELETE /manufacturing/v1/customers/delete?id=CUST-001
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | yes | Business code of the customer to delete. |