Represents one value of a classification, for example the value Austria of the classification Origin, or the value Recycled of the classification Packaging. In the Excel templates, types are registered on the Types sheet.
Classifications describe records with values from a fixed list. Each row of this resource is one value: it names its classification, the kinds of records the classification applies to, and the value's own code and name.
Types are a shared entity. They work the same way in every manufacturing domain model.
The Type object
{
"type": "Origin",
"appliesTo": ["material"],
"code": "AT",
"name": "Austria"
}
Fields
| Field | Type | Description | Example |
|---|---|---|---|
type |
string | Name of the classification this value belongs to. | "Origin" |
appliesTo |
array of strings | Codes of the kinds of records the classification applies to. | ["material"] |
code |
string | Business code of the value, unique within its classification. | "AT" |
name |
string | Human-readable name of the value. | "Austria" |
Classifications and their codes
The first value you register for a new type also creates the classification. Later values with the same type are added to it.
Pulse derives the classification's code from type: lower case, with spaces replaced by hyphens. For example, Origin becomes origin and Pack format becomes pack-format. Use this code where a record refers to the classification, for example as a key in a material's classifications.
Applies to
appliesTo lists the kinds of records the classification can be used on, by their code. For example, material for materials.
Among the shared entities, materials are the ones with classifications. Domain models can use classifications on their own records too. Their pages describe which classifications they use.
- At least one entry is required.
- Each entry must be a kind of record that exists in Pulse. An unknown code is refused.
Values in use
A value cannot be deleted while records still refer to it. Deleting the last value of a classification does not delete the classification.
API resource
| Resource | Base path |
|---|---|
Type |
/manufacturing/v1/types |
A value is identified by its type and its code together.
For the operations shared by all shared entities, see Shared entities API.
API methods
Create a value
POST /manufacturing/v1/types/insert
Registers a value and returns its Pulse identifier. If the classification does not exist yet, it is created. If the value already exists, it is updated.
Request
POST /manufacturing/v1/types/insert
Content-Type: application/json
{
"type": "Origin",
"appliesTo": ["material"],
"code": "AT",
"name": "Austria"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | yes | Name of the classification. |
appliesTo |
array of strings | yes | Codes of the kinds of records the classification applies to. At least one. |
code |
string | yes | Business code of the value. |
name |
string | yes | Human-readable name of the value. |
Update a value
PUT /manufacturing/v1/types/update
Updates an existing value. The value must already exist.
Request
PUT /manufacturing/v1/types/update
Content-Type: application/json
{
"type": "Origin",
"appliesTo": ["material"],
"code": "AT",
"name": "Republic of Austria"
}
Parameters
The parameters are the same as for creating a value. type and code identify the value to update.
Patch a value
PATCH /manufacturing/v1/types/patch
Partially updates an existing value.
The fields to update are supplied in the properties object. The value is identified by its type and code, which cannot be changed. Fields you leave out keep their current values.
Request
PATCH /manufacturing/v1/types/patch
Content-Type: application/json
{
"properties": {
"type": "Origin",
"code": "AT",
"name": "Republic of Austria"
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
properties |
object | yes | Fields included in the partial update. |
properties.type |
string | yes | Name of the classification of the value to update. |
properties.code |
string | yes | Business code of the value to update. |
properties.appliesTo |
array of strings | no | Codes of the kinds of records the classification applies to. |
properties.name |
string | no | New name of the value. |
Retrieve a value
GET /manufacturing/v1/types/select
Returns the value identified by its classification and code. If there is no such value, the response is empty.
Request
GET /manufacturing/v1/types/select?type=Origin&code=AT
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | yes | Name of the classification. |
code |
string | yes | Business code of the value. |
Example response
{
"type": "Origin",
"appliesTo": ["material"],
"code": "AT",
"name": "Austria"
}
List values
GET /manufacturing/v1/types/query
Returns values matching the supplied filters, one row per value.
Request
GET /manufacturing/v1/types/query?appliesTo=material
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
types |
string or array of strings | no | Limits results to values of the classifications with the specified names, for example Origin. Upper and lower case are not distinguished. |
classifications |
string or array of strings | no | Limits results to values of the classifications with the specified codes, for example origin. Upper and lower case are not distinguished. |
appliesTo |
string or array of strings | no | Limits results to classifications that apply to any of the specified kinds of records. |
codes |
string or array of strings | no | Limits results to values with the specified business codes. |
Example response
[
{
"type": "Origin",
"appliesTo": ["material"],
"code": "AT",
"name": "Austria"
}
]
Delete a value
DELETE /manufacturing/v1/types/delete
Deletes the value identified by its classification and code. If there is no such value, nothing happens. A value cannot be deleted while records still refer to it.
Request
DELETE /manufacturing/v1/types/delete?type=Origin&code=AT
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | yes | Name of the classification. |
code |
string | yes | Business code of the value to delete. |