Skip to content

consumerParameters

The consumerParameters is an array of objects. Each object defines a field and has the following structure:

AttributeTypeDescriptionRequired
namestringThe parameter name (this is sent as HTTP param or key towards algo)✅
typestringThe field type (text, number, boolean, select)✅
labelstringThe field label which is displayed✅
requiredbooleanIf customer input for this field is mandatory.✅
descriptionstringThe field description.✅
defaultstring, number, or booleanThe field default value. For select types, string key of default option.✅
optionsArray of optionFor select types, a list of options.☑️ (required for select types)

Each option is an object containing a single key: value pair where the key is the option name, and the value is the option value.

Example:
[
  {
    "name": "hometown",
    "type": "text",
    "label": "Hometown",
    "required": true,
    "description": "What is your hometown?",
    "default": "Nowhere"
  },
  {
    "name": "age",
    "type": "number",
    "label": "Age",
    "required": false,
    "description": "Please fill your age",
    "default": 0
  },
  {
    "name": "developer",
    "type": "boolean",
    "label": "Developer",
    "required": false,
    "description": "Are you a developer?",
    "default": false
  },
  {
    "name": "languagePreference",
    "type": "select",
    "label": "Language",
    "required": false,
    "description": "Do you like NodeJs or Python",
    "default": "nodejs",
    "options": [
      {
        "nodejs": "I love NodeJs"
      },
      {
        "python": "I love Python"
      }
    ]
  }
]