Get options for a specific product field
GET/v1/products/:id/field-options/:field_key
Retrieve the available options for a specific ENUM field of a product. This is useful for products that have fields with predefined options (e.g occupation for medical malpractice).These options should used to populate the dropdowns in the UI.
Request
Path Parameters
The ID of the product or the code of the product when the using_product_code
parameter is set to 1
The key of the field for which to retrieve options (e.g., 'indemnity_limit', 'duration', 'occupation', 'aggregated_claim_limit')
Query Parameters
Possible values: [0
, 1
]
Must be one of 1,0. Set to 1 when the id
path parameter contains the product code instead of the product ID
Responses
- 200
- 404
OK
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
data object
The field key for which options were retrieved
options object[]
Array of available options for the specified field
The option key/value
The human-readable label for the option
{
"data": {
"field_key": "occupation",
"options": [
{
"key": "general_practitioner",
"label": "General Practitioner"
},
{
"key": "cardiologist",
"label": "Cardiologist"
},
{
"key": "dentist",
"label": "Dentist"
}
]
}
}
Not Found
- application/json
- Schema
- Example (from schema)
Schema
{
"message": "Product not found"
}