Create a product variant
Create a product variant.
Authorizations:Token, JWT
Query Parameters
product_id required | integer |
Request Body Schema:
The new Product Variant resource sale_discount_type | stringDefault: "sale_percent" Enum: "sale_price" "sale_percent" Example: "sale_percent" | ||||||||
sale_price_value | number | ||||||||
cost_price | number or null | ||||||||
price | number | ||||||||
default_price | boolean | ||||||||
amount | integer | ||||||||
default_amount | boolean | ||||||||
weight | number | ||||||||
default_weight | boolean | ||||||||
default_variant | boolean | ||||||||
sku | string or null | ||||||||
image | object or null | ||||||||
| |||||||||
attribute_checkbox_values | Array of integers | ||||||||
attribute_select_values | Array of integers |
Responses
201Product Variant resource created
Response schema:
Product Variant resource created sale_discount_type | string | ||||||||
sale_price_value | number | ||||||||
default_sale_price | boolean | ||||||||
cost_price | number or null | ||||||||
id | integer>= 0 | ||||||||
price | number | ||||||||
default_price | boolean | ||||||||
amount | integer | ||||||||
default_amount | boolean | ||||||||
weight | number | ||||||||
default_weight | boolean | ||||||||
default_variant | boolean | ||||||||
sku | string or null | ||||||||
image | object or null | ||||||||
| |||||||||
attribute_checkbox_values | Array of integers | ||||||||
attribute_select_values | Array of integers |
400Invalid input
401Unauthorized
Response schema:
Unauthorized type | string |
title | string |
detail | string or null |
instance | string or null |
422Unprocessable entity
500Internal error
Response schema:
Internal error type | string |
title | string |
detail | string or null |
instance | string or null |