Create a Custom Field

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. 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.

API endpoint example

https://eu.intouch.capillarytech.com/v2/customFields

Prerequisites

  • Authentication - Basic Auth
    • User name: Capillary Intouch email ID of the admin user
    • Password: Intouch login password in MD5.

Resource information

URIv2/customFields
HTTP methodPOST
Pagination supported?NA
Rate limitNA
Batch supportNA

Header Information

Both the headers are mandatory.

X-CAP-API-AUTH-KEYAuth Key for internal API
X-CAP-API-AUTH-ORG-IDOrg ID

Body parameters

ParameterData TypeDescription
scopeSTRINGThe entity for which the custom field will be applicable. For example, the custom fields created for the scope LOYALTY_REGISTRATION will be applicable only for the LOYALTY_REGISTRATION entity. Supported values are:

- 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
- NI_CUSTOM_FIELDS - Not in use.
- CUSTOMER_CARD
- TILL_CUSTOM_FIELDS
- ORG_CUSTOM_FIELD: Applicable for the entire org.
customFieldsARRAYIncludes the custom fields that need to be created.
- nameSTRINGName of the custom field. The maximum number of characters supported is 20.
- typeSTRINGField type of the custom field. The supported types are text, textarea, select, checkbox, radio, file, template_area, datepicker, separator, button, email_body, feedback, and label
- dataTypeEnumData type of the custom field. The supported data types are Boolean, Integer, Double and String.
- labelSTRINGName to be displayed on the UI.
- defaultValueSTRINGDefault value assigned to the custom field, e.g., "#1234". This value is only Meta data and is not tagged to entity by default. Note: This field applies to client-side applications like Instore and does not undergo any server-side validation.
- phaseSTRING/INTThis is applicable for Instore and is not in use.
- positionINTSpecify the sequence order of the custom field. For example, 1 to appear in the first position of the form. This field applies to client-side applications like Instore and does not undergo any server-side validation.
- ruleSTRINGAllows you to specify logical expressions in the Infix expression language. You can use placeholders like {{custom_field_name}}, which will be dynamically replaced with actual values during evaluation.
- serverRuleSTRINGAllows you to define rules in Infix form. You should use the following format to specify the rule:
{"name":"{{custom_field_name}}","value":"{{custom_field_value}}"}
In this format, {{custom_field_name}} serves as a placeholder for the field's name, while {{custom_field_value}} represents the corresponding value. These placeholders will be dynamically replaced with actual values during evaluation, enabling flexible and context-specific rule processing.
- regexSTRINGRegular expression for validation (if any). For example, you can use regex to validate an email field.
- errorSTRINGError message to display for invalid input (if any).
- isDisabledBOOLEANIndicates if the custom field is disabled (0 for false). This field applies to client-side applications like Instore and does not undergo any server-side validation.
- isCompulsoryBOOLEANIndicates if the custom field is mandatory (0 for false). This field applies to client-side applications like Instore and does not undergo any server-side validation.
- disableAtServerBOOLEANIndicates if the field is disabled on the server (0 for false).
- isUpdatableBOOLEANIndicates if the field can be updated (0 for false). This field applies to client-side applications like Instore and does not undergo any server-side validation.
- enableAuditTrailBOOLEANSpecifies if audit trails are enabled (0 for false).
- isPiiDataBOOLEANMarks if the field contains PII data (0 for false).
- isPsiDataBOOLEANMarks if the field contains PSI data (0 for false).
- helptextSTRINGHelp text associated with the field (if any).
- attrsSTRINGAdditional attributes for the field (if any).
{
  "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.

Response parameters

{
    "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
}

Error codes

Error CodeErrorDescription
91032NOT_AN_ADMIN_USEROnly admin user can access the endpoint.
1018INVALID_CUSTOM_FIELD_SCOPEProvided scope is invalid.
1023AUDITABLE_CUSTOM_FIELDS_COUNT_BREACHEDMaximum auditable custom field limit is {0}, existing count is {1} (including the current payload).
1024CUSTOM_FIELD_PARAM_NULL_OR_EMPTYCustom field parameter {0} is null or empty.
1025DUPLICATE_ORG_CUSTOM_FIELDDuplicate organisation custom field: {0}.
1026FAILED_TO_SAVE_CUSTOM_FIELDSFailed to save custom fields. Try again.
1028CUSTOM_FIELD_LIST_NULL_OR_EMPTYNull 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.

Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!