Wiki
Clone wikiAPI-2.0 / Custom_fields_for_booking
Method: GET
Path: /booking/custom_fields
Return list of booking custom fields.
Query params
booking_uuid
(optional)
Booking digest. MUST be provided if custom fields requested for existing booking. (requires authentication)
Example of response
[ { "id": 25, "code": "custom_drop_down", "label": "Drop Down", "control_type": "drop_down", "value_required": false, "visible": true, "ordering": 0, "default_value": "aaa", "options": [ { "id": 2, "label": "AAA", "value": "aaa", "order": 0, "other": false, "default": false, "active": true }, { "id": 3, "label": "BBB", "value": "bbb", "order": 0, "other": false, "default": false, "active": true } ] }, { "id": 250, "code": "custom_single_line", "label": "Why?", "control_type": "single_line", "value_required": false, "visible": true, "ordering": 0, "default_value": "", "help_text": "" }, { "id": 248, "code": "custom_checkboxes", "label": "Any?", "control_type": "checkboxes", "value_required": true, "visible": true, "ordering": 0, "default_value": "aaa", "help_text": "", "options": [ { "id": 6, "label": "AAA", "value": "aaa", "order": 0, "other": false, "default": true, "active": true }, { "id": 8, "label": "BBB", "value": "bbb", "order": 1, "other": false, "default": false, "active": true } ] }, { "id": 247, "code": "dont_worry_text", "label": "", "control_type": "plain_text", "value_required": false, "visible": true, "ordering": 52, "text": "Don't worry, you won't be billed until the day of service and you will receive an email receipt instantly. We no longer accept cash or checks.", "settings": { "before_submit_button": true } } ]
- custom field attributes:
id
is custom field unique IDcode
is unique value for custom field, automatically assigned when custom field cratedlabel
is custom field label, value could be emptycontrol_type
is type of UI control that should be used for custom field, possible control types:single_line
expected single line UI input elementmulti_line
expected multi line (text area) UI input elementradio_buttons
expected group of radiobuttons UI input element, only one value allowed to be selectedcheckboxes
expected group of checkboxes UI input element, more than one value allowed to be selecteddrop_down
expected a dropdown (select) UI input element, only one value allowed to be selectedplain_text
expected to be displayed as plain text, custom field does not accept any valuesdate
expected datepicker or similar UI input element, value supposed to be provided in format YYYY-MM-DD (example "2006-01-02")datetime
expected datetimepicker or similar UI input element, value supposed to be provided in format YYYY-MM-DDTHH:MM:SS (example "2006-01-02T15:04:05")checkbox
expected single checkbox or switch UI input element, value supposed to be "true" or "false" (also could be empty if custom field value is notvalue_required
).
value_required
value is true if custom field configured as requires valuevisible
value is true if custom field configured as visible (i.e. not hidden)ordering
is configured order of custom field in the list of custom fieldsdefault_value
may or may not be configured for custom field; if configured supposed to be pre-entered for new booking, but NOT for existing booking (i.e. ifbooking_uuid
parameter used to query custom fields)help_text
may or may not be configuredtext
may or may not present for custom fields withcontrol_type
:single_line
,multi_line
,plain_text
,date
,datetime
orcheckbox
settings
present only for custom fields withcontrol_type
:plain_text
orcheckbox
options
present only for custom fields with multi-choicecontrol_type
:radio_buttons
,checkboxes
ordrop_down
- options attributes:
id
is custom field option unique IDlabel
is custom field option labelvalue
is custom field option value; option should be pre-selected if curresponds to custom field'sdefault_value
order
is configured order for custom field option in the list of custom field optionsother
if true means that if option selected it is required to provide additional explanation, i.e. display free text UI input element for option if option selected. Note: it is possible that more than one option of the same custom field hasother
= truedefault
if true means that option configured as default, supposed to be pre-selected for new booking, but NOT for existing booking (i.e. ifbooking_uuid
parameter used to query custom fields)active
always true if custom fields requested for new booking (i.e. parameterbooking_uuid
was not used), otherwise (i.e. parameterbooking_uuid
was used) may be false if option was selected for booking while option was active
- settings attributes:
before_submit_button
if true custom field expected to be displayed before booking form submit button; could beplain_text
text and/or accept terms and conditionscheckbox
Example request:
For production, replace https://acme-sandbox.l27.co
with https://<your subdomain>.launch27.com
curl -H "Content-Type: application/json" \ -X GET -k \ https://acme-sandbox.l27.co/latest/booking/custom_fields
Example request (as logged-in):
For production, replace https://acme-sandbox.l27.co
with https://<your subdomain>.launch27.com
Replace BEARER_FROM_LOGIN with bearer
from Login
curl -H "Content-Type: application/json" \ -H 'Authorization: Bearer BEARER_FROM_LOGIN' \ -X GET -k \ https://acme-sandbox.l27.co/latest/booking/custom_fields?booking_uuid=NcUHgV93Vkf7Jxgr8P6rvOi3DMLpYvc2
Updated