User-Defined Field Definitions

User-Defined Field (UDF) Definitions allow you to structure and organize your User-Defined Fields. With UDF Definitions, you can set data formats, default values, and validation rules for each UDF. This ensures that the data in your UDF fields can be compatible with your ecommerce store.

UDF Definitions can be set up for Customers, Customer Addresses, Subscriptions, Group Subscriptions, and Products.

Configure a new or edit and existing UDF Definition by navigating to Environment Settings > User-Defined Field Definitions > New or Edit.

Field CodeUnique string that must be at least 4 characters long
Entity TypeThe entity type this rule will be assigned to. UDFs are available on Customer, Customer Address, Subscription, Group Subscription, and Product entities.
Field TypeThe type of field that best supports the data. This is the type of UI element used to input that UDF value. See available Field- and Data-Type pairings.
Data TypeData type for UDF Value. This controls how the data is sent and received by SubscribePro. See available Field- and Data-Type pairings.
Validate DateChoose if data will be validated before saving.
Default ValueSet a default value for the UDF
Populate DefaultChoose if UDF will be automatically populated on new instances of the assigned entity. Existing instances will not be updated with the new UDF.

Assign UDF Definitions

You can automatically add a User-Defined Field to new Customer, Customer Address, Subscription, Group Subscription, and Product entities by selecting the Populate Default Value option. If you specify a default value, it will also be populated on new entities as they are created."

UDF Definition Populate Default

If the Don't Populate Default Value Option is selected, a definition can be added to an entity by using the exact Field Code when adding a new UDF to an inidividual entity.

UDF Definition List Highlight Field Code

UDF Definition List Highlight Field Code

The field type will be assigned and cannot be changed. If a default value exists, it will populate.

UDF Definition on Customer

Defining Select Options

If you are using the Select field type for your User-Defined Field, you can set the list of options through the UDF Definition. Select fields must be used with the String data type. For each option, you must set a label and value. There is no limit to the number of options.

UDF Definition Select Options

The value controls how the option will be stored and presented in the API. The label controls how the option appears in the UI.

UDF Select Options

You may select one of the options to be the default option. If you don't select a default option, then the first option will be used as the default.

UDF Definition Select Options Default

User-Defined Fields Back-End Data Types

The below table lists the data types and their validation requirements. SubscribePro will only enforce these requirements if you select "true" value for the "Validate Data" setting in the UDF Definition.

Data TypeRequirementsExamples
stringNull or string value"example", "1"
numberInteger or float1, 1.1
dateString in the date format Y-m-d"2000-01-15"
datetimeString in the ISO 8601 date/time values which include at least hours and minute, date-only is not allowed - negative timezone offset not allowed."2022-05-27T16:01:29", "2022-05-27T16:01:29+0000"
booleanBooleantrue, false
json_objectKey/value array, null or empty array{}, {'key' => 'value'}
json_arrayArray, null or empty array[], [0, 1, 2]