PayNow

StorefrontCustomVariableDto

descriptionstringRequired
Description explaining what this custom variable is for. Can be shown to customers.
identifierstringRequired
Unique identifier string used to reference this custom variable programmatically. Must contain only letters, numbers, underscores, and hyphens.
namestringRequired
Display name for the custom variable shown to customers.
optionsStorefrontCustomVariableOptionDto[]Required
Available options for dropdown type custom variables. Empty for text and number types.
is_defaultbooleanRequired
Whether this option is selected by default when the custom variable is presented. Only one option per custom variable should be marked as default.
namestringRequired
Display name shown to customers for this option.
priceintegerRequired
Additional price in the lowest denominator (e.g. cents) when this option is selected.
sort_orderintegerRequired
Sort order for displaying options to customers. Lower numbers appear first.
valuestringRequired
Internal value used for product command variable replacement, without brackets.
typeenumRequired
Defines the type of input method for a custom variable.
Possible enum values
  • dropdown

    Dropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.

  • text

    Free-form text input. Customers can enter any text value (subject to validation).

  • number

    Numeric input. Customers can enter numeric values (subject to validation).

value_regexstringOptional
Optional regex pattern to validate text/number input values. Only applies to text and number types. Uses RE2 syntax - does not support negative lookarounds, backreferences, or other advanced regex features.
Example
{
  "description": "string",
  "identifier": "string",
  "name": "string",
  "options": [
    {
      "is_default": true,
      "name": "string",
      "price": 0,
      "sort_order": 0,
      "value": "string"
    }
  ],
  "type": "dropdown",
  "value_regex": "string"
}