API Playground - add_custom_property_definition

add_custom_property_definition


Adds a new custom property definition to your site or metasite. This will show the new property in resource settings / general info in the backend UI (for resource properties), or in site settings / company info (for site properties) or in site settings / custom user properties (for user properties). Custom property definitions are required if you need them as search criteria or resource listing filters. If the property definition (or any of the aliases) already exists, it will not be overridden. (click for full documentation)

name

Custom property name

type

Property type. One of: 'text', 'dropdown', 'checkbox', 'textarea', 'multiple_checkboxes', 'gps', 'persons', 'url', 'tax_rate'. These correspond to the property types found in the backend UI. Default value is 'text'.

possible_values

In case of the 'dropdown' type, you must enter comma-separated possible values.

search_condition

Leave this empty unless you want the property to be used as a search criterium (not applicable to user properties). In such case enter one of the following: 'eq': search finds only the exact value, 'gte': for numeric values it's the >= operator, 'gt': numeric >, 'lte': numeric <=, 'lt': numeric <, 'mv_': in search presented as multiple checkboxes (at least one must match), 'm2_': in search presented as multiple checkboxes (all must match), 'cnt': (for text values) value must contain text specified in search box, 'chk': must be chosen if type is 'checkbox' unless you don't need this as a search criterium.

scope

One of 'resource', 'user', 'site'. Default is 'resource'. This determines whether the custom property definition is for resource properties, user properties or site properties. The value 'site' is used only by metasites.

comment

Optionally you can add a comment which will be visible when setting the value of this custom property for a resource (not applicable to user properties).

icon

Optionally you can set one of the supported icon identifiers (e.g. mdi-xxx). Not applicable to user properties

default_visibility

Optionally you can set the default visibility in resource details and listings templates (not applicable to user properties): 0 = none, 1 = resource details page, 3 = resource details and listing pages.

default_value

Set this only for a custom user property. This is the default value set for all new users.

form_item_name

Set this only for a custom user property. This is the name of the associated reservation form field.

aliases

You can pass a comma-separated string of aliases. If an existing property definition with the alias name exists, the custom property will not be added.

language

by specifying a 2-letter (ISO 639-1) language code (all capital letters e.g. EN, DE, FR, ES, IT) you can change the language of the text values returned

api_key

* - påkrevd felt