Create a Custom Field

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

This API allows you to create custom fields, either applicable across all entities within the organization or specific to a single entity, such as a loyalty transaction. Field names must be unique within each organization, regardless of the scope. You cannot create multiple custom fields with the same name in different scopes within the same organization.

You can create custom fields with the same name separately for the parent and child organizations. This is useful in scenarios where you want to assign distinct values to the custom field at the parent and child levels, such as setting different header content in email campaigns for each organization.

Note: For customer registration, it is recommended to avoid using identical custom field names for both parent and child organizations. When a custom field with the same name exists at both levels, the value at the parent level will always override that of the child organization.

Example request

curl --location 'https://eu.intouch.capillarytech.com/v2/customFields' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmVlcm4YTcwNmM0YzM0YTE2ODkxZjg0ZTdi' \
--data '{
    "scope": "LOYALTY_REGISTRATION",
    "customFields": [
        {
            "name": "test2",
            "type": "textarea",
            "dataType": "String",
            "label": "test2",
            "scope": "LOYALTY_REGISTRATION",
            "defaultValue": "",
            "phase": "1",
            "position": 7,
            "rule": "",
            "serverRule": "",
            "regex": "",
            "helptext": "",
            "error": "Enter your special_instructions",
            "attrs": "",
            "isDisabled": 0,
            "isCompulsory": 0,
            "isUpdatable": 1,
            "disableAtServer": 0,
            "enableAuditTrail": 0,
            "isPiiData": 0,
            "isPsiData": 0,
            "options": "",
            "value": ""
        }
    ]
}'

Prerequisites

Body parameters

FieldTypeRequiredDescription
scopestringRequiredThe entity for which the custom field is applicable. Supported values: LOYALTY_REGISTRATION, LOYALTY_TRANSACTION, CUSTOMER_FEEDBACK, POINTS_REDEMPTION, VOUCHER_REDEMPTION, ZONE_CUSTOM_FIELDS, STORE_CUSTOM_FIELDS, CUSTOM_FIELDS_DATA_LOG, CHECK_IN_FEEDBACK, CUSTOMER_PREFERENCES, ADVANCE_FEEDBACK, LOYALTY_LINE_ITEMS (not in use), NI_CUSTOM_FIELDS (not in use), CUSTOMER_CARD, TILL_CUSTOM_FIELDS, ORG_CUSTOM_FIELD (applicable for the entire org).
customFieldsarrayRequiredList of custom fields to create.
.namestringRequiredName of the custom field. Max 20 characters.
.typestringRequiredField type. Supported values: text, textarea, select, checkbox, radio, file, template_area, datepicker, separator, button, email_body, feedback, label.
.dataTypeenumRequiredData type of the custom field. Supported values: Boolean, Integer, Double, String.
.labelstringOptionalDisplay name shown in the UI.
.defaultValuestringOptionalDefault value for the custom field, for example, "#1234". This is metadata only and is not tagged to an entity by default. Applies to client-side applications like Instore; not validated server-side.
.phasestringOptionalApplicable for Instore only; not in use.
.positionintegerOptionalDisplay order of the custom field in the form, for example, 1 for first position. Applies to client-side applications like Instore; not validated server-side.
.rulestringOptionalLogical expression in Infix expression language. Use placeholders like {{custom_field_name}}, which are replaced with actual values during evaluation.
.serverRulestringOptionalRule in Infix form. Format: {"name":"{{custom_field_name}}","value":"{{custom_field_value}}"}. Placeholders are replaced with actual values during evaluation.
.regexstringOptionalRegular expression for input validation, for example, to validate an email address.
.errorstringOptionalError message to display for invalid input.
.helptextstringOptionalHelp text for the field.
.attrsstringOptionalAdditional attributes for the field.
.optionsstringOptionalAdditional options for the field.
.valuestringOptionalValue associated with the custom field.
.isDisabledbooleanOptionalIndicates whether the custom field is disabled. 0 for false. Applies to client-side applications like Instore; not validated server-side.
.isCompulsorybooleanOptionalIndicates whether the custom field is mandatory. 0 for false. Applies to client-side applications like Instore; not validated server-side.
.isUpdatablebooleanOptionalIndicates whether the custom field can be updated. 0 for false. Applies to client-side applications like Instore; not validated server-side.
.disableAtServerbooleanOptionalIndicates whether the field is disabled on the server. 0 for false.
.enableAuditTrailbooleanOptionalIndicates whether audit trails are enabled for the field. 0 for false.
.isPiiDatabooleanOptionalIndicates whether the field contains PII data. 0 for false.
.isPsiDatabooleanOptionalIndicates whether the field contains PSI data. 0 for false.
{
  "scope": "ORG_CUSTOM_FIELD",
  "customFields": [
    {
      "name": "Email Footer Color",
      "type": "text",
      "dataType": "STRING",
      "label": "Mail content",
      "scope": "ORG_CUSTOM_FIELD",
      "defaultValue": "#1234",
      "phase": "1",
      "position": 0,
      "rule": "",
      "serverRule": "",
      "regex": "",
      "error": "",
      "isDisabled": 0,
      "isCompulsory": 0,
      "disableAtServer": 0,
      "isUpdatable": 0,
      "enableAuditTrail": 0,
      "isPiiData": 0,
      "isPsiData": 0,
      "helptext": "",
      "attrs": ""
    }
  ]
}
📘

Note

The maximum number of auditable custom fields that can be created is controlled by the PRODUCT_CONF_ORG_AUDITABLE_CUSTOM_FIELDS_LIMIT configuration. If this configuration is not set for a specified organisation, the default limit is set to 5 at the backend.

Example response

{
    "entity": [
        {
            "orgId": 50399,
            "name": "Email Footer Color",
            "type": "text",
            "dataType": "STRING",
            "label": "Mail content",
            "scope": "ORG_CUSTOM_FIELD",
            "defaultValue": "#1234",
            "phase": "1",
            "position": 0,
            "rule": "",
            "serverRule": "",
            "regex": "",
            "error": "",
            "isDisabled": 0,
            "isCompulsory": 0,
            "disableAtServer": 0,
            "isUpdatable": 0,
            "enableAuditTrail": 0,
            "isPiiData": 0,
            "isPsiData": 0,
            "helptext": "",
            "attrs": "",
            "value": ""
        }
    ],
    "warnings": [],
    "errors": [],
    "success": true
}

Response parameters

FieldTypeDescription
entityarrayList of custom fields that were created.
.orgIdintegerUnique identifier of the organization.
.namestringName of the custom field.
.typestringField type of the custom field.
.dataTypestringData type of the custom field.
.labelstringDisplay name of the custom field shown in the UI.
.scopestringEntity scope for which the custom field is applicable.
.defaultValuestringDefault value assigned to the custom field.
.phasestringPhase of the custom field (Instore only).
.positionintegerDisplay order of the custom field in the form.
.rulestringLogical expression rule for the custom field.
.serverRulestringServer-side rule for the custom field.
.regexstringRegular expression for validation.
.errorstringError message for invalid input.
.helptextstringHelp text for the custom field.
.attrsstringAdditional attributes for the custom field.
.valuestringValue associated with the custom field.
.isDisabledbooleanIndicates whether the custom field is disabled. 0 for false.
.isCompulsorybooleanIndicates whether the custom field is mandatory. 0 for false.
.isUpdatablebooleanIndicates whether the custom field can be updated. 0 for false.
.disableAtServerbooleanIndicates whether the field is disabled on the server. 0 for false.
.enableAuditTrailbooleanIndicates whether audit trails are enabled for the field. 0 for false.
.isPiiDatabooleanIndicates whether the field contains PII data. 0 for false.
.isPsiDatabooleanIndicates whether the field contains PSI data. 0 for false.
warningsarrayList of warnings returned by the API.
errorsarrayList of errors returned by the API.
successbooleanIndicates whether the request was successful.

Error & warning codes

CodeError numberTypeDescription
INVALID_CUSTOM_FIELD_SCOPE1018ErrorProvided scope is invalid.
AUDITABLE_CUSTOM_FIELDS_COUNT_BREACHED1023ErrorMaximum auditable custom field limit is 0, existing count is 1 (including the current payload).
CUSTOM_FIELD_PARAM_NULL_OR_EMPTY1024ErrorCustom field parameter 0 is null or empty.
DUPLICATE_ORG_CUSTOM_FIELD1025ErrorDuplicate organization custom field: 0.
FAILED_TO_SAVE_CUSTOM_FIELDS1026ErrorFailed to save custom fields. Try again.
CUSTOM_FIELD_LIST_NULL_OR_EMPTY1028ErrorNull or empty custom field list.

Note: In the descriptions, {0} and {1} are placeholders that will be replaced with specific values, such as the maximum limit, current count, or field name based on the context.

Body Params
string
Headers
string
required
string
required
Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json