Skip to main content

Custom Fields

What you can do with Fields

Field Properties:

code
REQUIRED

Type: string

A unique field code. A unique field identifier is used in API requests. Can contain only letters, digits and underscore. Starts with letter.

Example: business_email

workspace
REQUIRED

Type: string (format: iri-reference)

The workspace reference to which the field belongs.

Example: /workspaces/cbe5589f-8869-4a9c-9d9c-3d7f70d66878

entity
REQUIRED

Type: string

The entity name to which the field belongs. Should be only one of orders or shipments.

Example: orders

title
REQUIRED

Type: string

Field name.

Example: Business Email

fieldType
REQUIRED

Type: string

Field type code.

Example: email

supported field types:

  • text
  • date
  • phone
  • password
  • email
  • number
  • link
  • select
  • array
  • label

Depended on the selected field type, the corresponded validation rule will be applied for the field.

readonly

Type: boolean|null

Determines if the field is not writeable.

Example: false

sorting

Type: boolean|null

Determines if the field can be used for sorting.

Example: true

selectOptions

Type: object|null

Options for select field type. Represented by the FieldSelectOptions object.

Example:
"selectOptions": {
  "keyField": "string|null",
  "titleField": "string|null",
  "options": "array|null",
  "url": "string|null"
}
  • keyField:
  • titleField:
  • options:
  • url:

visibleExpr

Type: string|null

The expression that allows to determinate if field should be visible.

Example: authType==="login"

validation

Type: string|null

The validation rules for the fields.

Example: required|email

default

Type: string|null

The default value for the field.

Example: my@company.com

placeholder

Type: string|null

The placeholder value for the field.

Example: Enter your business email address

refreshOnChange

Type: boolean|null

Determines if the entity will be refreshed after field changes.

Example: true

helperText

Type: string|null

The helper text for the field.

Example: Enter your business email to receive all emails from support team.

tags

Type: array

The list of tags for the field.

Example: ['emails']

options

Type: array

primary
READ-ONLY

Type: boolean

Primary field means defined statically. Custom field is from EAV

Endpoints

GET
/fields
Retrieves the collection of Field resources.
Query Parameters
NameInIs RequiredTypeDescription
workspace.idqueryNostring
workspace.id[]queryNoarray
Array of Strings.
groups[]queryNoarray
Array of Strings.
GET
/fields/{code}
Retrieves a Field resource.
Query Parameters
NameInIs RequiredTypeDescription
codepathYesstringResource identifier
POST
/fields
Creates a Field resource.
Query Parameters
NameInIs RequiredTypeDescription
Request Body Parameters

code
REQUIRED

Type: string

A unique field code. A unique field identifier is used in API requests. Can contain only letters, digits and underscore. Starts with letter.

Example: business_email

workspace
REQUIRED

Type: string (format: iri-reference)

The workspace reference to which the field belongs.

Example: /workspaces/cbe5589f-8869-4a9c-9d9c-3d7f70d66878

entity
REQUIRED

Type: string

The entity name to which the field belongs. Should be only one of orders or shipments.

Example: orders

title
REQUIRED

Type: string

Field name.

Example: Business Email

fieldType
REQUIRED

Type: string

Field type code.

Example: email

supported field types:

  • text
  • date
  • phone
  • password
  • email
  • number
  • link
  • select
  • array
  • label

Depended on the selected field type, the corresponded validation rule will be applied for the field.

PUT
/fields/{code}
Replaces the Field resource.
Query Parameters
NameInIs RequiredTypeDescription
codepathYesstringResource identifier
Request Body Parameters

title
REQUIRED

Type: string

Field name.

Example: Business Email

DELETE
/fields/{code}
Removes the Field resource.
Query Parameters
NameInIs RequiredTypeDescription
codepathYesstringResource identifier