Types

Types define custom fields that are used to enhance resources as you need.

Since there is no model that fits all use-cases, we give you the possibility to customize some resources, so that they fit your data model as close as possible.

Use Types to model your own CustomFields on resources, like Category and Customer.

In case you want to customize products, please use product types instead that serve a similar purpose, but tailored to products.

Representations

Type

TypeDraft

TypeDrafts are given as payload for Create Type requests.

FieldDefinition

Field definitions describe custom fields and allow you to define some meta-information associated with the field.

FieldType

All field types have a name. Some have additional fields such as values in enums or elementType in sets.

BooleanType

Valid values for the field are true and false (JSON Boolean).

StringType

LocalizedStringType

EnumType

LocalizedEnumType

NumberType

MoneyType

DateType

TimeType

DateTimeType

ReferenceType

SetType

The set field type defines a set (array without duplicates) with values of the given elementType.

TextInputHint

Provides a visual representation type for this field. It is only relevant for string-based field types like StringType and LocalizedStringType.
A text input hint is a string with one of the following values:

EnumValue

LocalizedEnumValue

Get Type by ID

Endpoint: /{projectKey}/types/{id}
Method: GET
OAuth2 Scopes: view_types:{projectKey}
Response Representation: Type

Get Type by Key

Endpoint: /{projectKey}/types/key={key}
Method: GET
OAuth2 Scopes: view_types:{projectKey}
Response Representation: Type

Query Types

Endpoint: /{projectKey}/types
Method: GET
OAuth2 Scopes: view_types:{projectKey}
Response Representation: PagedQueryResult with the results array of Type
Query Parameters:

Create Type

Endpoint: /{projectKey}/types
Method: POST
OAuth2 Scopes: manage_types:{projectKey}
Request Representation: TypeDraft
Response Representation: Type

Update Type by ID

Endpoint: /{projectKey}/types/{id}
Method: POST
OAuth2 Scopes: manage_types:{projectKey}
Response Representation: Type
Fields:

Update Type by Key

Endpoint: /{projectKey}/types/key={key}
Method: POST
OAuth2 Scopes: manage_types:{projectKey}
Response Representation: Type
Fields:

Update Actions
Please find below the individual update actions provided on this endpoint.


Change Key

Change Name

Set Description

Add FieldDefinition

Remove FieldDefinition

Change FieldDefinition Label

Add EnumValue to FieldDefinition

Adds an enum to the values of EnumType. It can update an EnumType field definition or a Set of EnumType field definition.

Add LocalizedEnumValue to FieldDefinition

Adds an localized enum to the values of LocalizedEnumType. It can update a LocalizedEnumType field definition or a Set of LocalizedEnumType field definition.

Change the order of FieldDefinitions

Change the order of EnumValues

This action changes the order of enum values in an EnumType field definition. It can update an EnumType field definition or a Set of EnumType field definition.

Change the order of LocalizedEnumValues

This action changes the order of localized enum values in a LocalizedEnumType field definition. It can update a LocalizedEnumType field definition or a Set of LocalizedEnumType field definition.

Delete Type by ID

Endpoint: /{projectKey}/types/{id}
Method: DELETE
OAuth2 Scopes: manage_types:{projectKey}
Query Parameters:

Delete Type by Key

Endpoint: /{projectKey}/types/key={key}
Method: DELETE
OAuth2 Scopes: manage_types:{projectKey}
Query Parameters:

comments powered by Disqus