Create option group
POST/api/v2/catalog/options
Create a new option group for a given business or product
You must provide either a business_id
or a product_id
Request
- application/json
Body
required
- MOD1
- MOD2
Array [
]
anyOf
Business ID to associate the group with
Possible values: >= 12 characters
and <= 12 characters
, Value must match regular expression ^[0-9a-z]+$
Product ID to associate the group with
Possible values: non-empty
Name of the product option group
options
object[]
Possible values: non-empty
Name of the product option
Default value: 0
The additional price of the option, can be 0 or negative
The SKU of the option
The reference code of the option
Default value: true
Mark the option as not available
Default value: 0
Used to order the item, order defaults to ascending.
Responses
- 201
- 400
- 401
- 403
- 404
- 422
- 500
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
Possible values: >= 12 characters
and <= 12 characters
, Value must match regular expression ^[0-9a-z]+$
Unique ID of the product option group
Possible values: non-empty
Name of the product option group
Business id linked to the group
options
object[]
required
Possible values: non-empty
Name of the product option
Default value: 0
The additional price of the option, can be 0 or negative
The SKU of the option
The reference code of the option
Default value: true
Mark the option as not available
Default value: 0
Used to order the item, order defaults to ascending.
{
"id": "95a1o6hmh0qv",
"name": "Additional Ingredients",
"business_id": "cd9feea7-99f4-4e90-897f-8b4f7cac8c59",
"options": [
{
"name": "Mushrooms",
"price": "12.5",
"sku": "123456",
"ref_code": "123456",
"available": true
}
],
"order": 1,
"created_at": "2024-07-29T15:51:28.071Z",
"updated_at": "2024-07-29T15:51:28.071Z"
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
HTTP status code
Error message
Possible values: [query
, body
, response
, param
]
Where in the request the error occurred
errors
object[]
required
Possible values: non-empty
Path to the property with the error
constraints
object
required
Error message
{
"statusCode": 404,
"message": "Cannot find item",
"location": "query",
"errors": [
{
"path": "business.id",
"constraints": {
"object_required_property": "Required property"
}
}
]
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}