Create product variant
Authorization
bearerAuth In: header
Path Parameters
Id of the product
Request Body
application/json
0 <= valueList of barcodes, associated with a variant
Informs whether this is a default variant, for a product. Every product must have exactly one default variant at all times.
falseURL to thumbnail. If not provided best-effort will be taken to resolve thumbnail url automatically
Marks whether thumbnail is a valid image. Can only be specified if 'thumbnail' was also specified and it's value is not empty. If 'thumbnail' was specified then default value for this field is 'false'. Otherwise there is no default value and this field's value depends on whether thumbnail's url was automatically resolved
Client defined product variant identifier
length <= 255Response Body
application/json
application/json
curl -X POST "https://oasis-api.public.sandbox.oasis.aifi.com/api/admin/v2/products/0/variants" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "weight": 0, "barcodes": [ { "isDefault": true, "barcode": "string" } ], "thumbnail": "string" }'{
"id": 0,
"name": "string",
"thumbnail": "string",
"invalidThumbnail": true,
"externalId": "string",
"weight": "string",
"barcodes": [
{
"isDefault": true,
"barcode": "string"
}
],
"isDefault": true,
"productId": 0
}{
"message": "Invalid request body",
"type": "E_INVALID_BODY",
"errors": [
{
"error": "\"email\" is required",
"rule": "any.required",
"field": "\"email\""
}
]
}How is this guide?