Product options allow customers to customize products before adding them to their cart, such as selecting a size, color, or adding personalization. This documentation describes the various fields and properties available for product options in the Venddor API.
Note: The Venddor REST API always accepts and returns data as strings and arrays/objects. The data types shown in the "Values" column below indicate the logical data type of each field, not the format in which they are transmitted.
Option Field Reference
The following table provides a comprehensive list of all fields available for product options:
Basic Information
Field
Values
Description
option_id
integer
A unique identifier of the option.
product_id
integer
A unique identifier of the product that the option is associated with.
company_id
integer
ID of the associated vendor.
option_name
string
The name of the option as displayed to customers (e.g., "Size", "Color").
position
integer
This parameter determines the position of the option among other options. The lower this number, the higher the option appears on the list of options in the Administration panel.
Option Configuration
Field
Values
Description
option_type
string
The type of the option: S — Select box R — Radio group C — Checkbox I — Text (one line) T — Text area F — File
required
Y/N
If an option is required (Y), customers won't be able to add a product to cart without specifying this option. For example, if a checkbox has required=Y, a customer must tick it before adding the product to cart.
inventory
Y/N
If enabled (Y), the option is taken into account when forming the product inventory.
status
string
The status of the option: A — Active D — Disabled
value
string
The number of the option variant or the text entered in the field of Text or Text area option by the customers.
Display Settings
Field
Values
Description
description
string
If you fill in this field, the ? icon (tooltip) will appear near the option name on the product page. When you hover your mouse over the icon, you'll see the description text.
inner_hint
string
A hint that appears in the field of a Text or Text area option. It tells the customers what they should enter in the field. The hint doesn't serve as a default value.
comment
string
The text that appears below the option on the storefront.
missing_variants_handling
string
If the option type is Select box or Radiogroup, you can specify the variants of the option that customers can choose from. This field determines what to do when the administrator didn't create variants for the option.
M — Display a message next to the option name. By default the message is "N/A" H — Hide this option
Validation Settings
Field
Values
Description
regexp
string
If the option type is Text or Text area, you can use regular expressions to limit what users can enter in the field.
incorrect_message
string
If you use regexp for Text or Text area options, this message appears when the entered text doesn't conform to the regular expression.
File Upload Settings
Field
Values
Description
multiupload
Y/N
If the option type is File, you can choose whether to allow customers to upload multiple files (Y) or limit them to a single file (N).
allowed_extensions
string
If the option type is File, you can specify the allowed extensions separated by commas (e.g. jpg,bmp,gif,pdf).
max_file_size
integer
The maximum size of the uploaded files (in kilobytes).
Option Variants
Field
Values
Description
variants
object
The variants of the option. Variants are available to the options of the Select box or Radiogroup type. An option of the Checkbox type has 2 variants by default.
Tip: For Text and Text area options, using the regexp field in conjunction with incorrect_message is a powerful way to ensure customers provide properly formatted information. For example, you could validate email addresses, phone numbers, or ensure text follows specific formatting requirements.
Important: When using regex field validation, make sure to set the incorrect_message field as well. If the incorrect_message field is empty, the regular expression validation will not run.