Admin api products

Create product variant

POST
/api/admin/v2/products/{productId}/variants

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

productId*integer

Id of the product

Request Body

application/json

name*string
weight*number
Range0 <= value
barcodes*array<>

List of barcodes, associated with a variant

isDefault?boolean

Informs whether this is a default variant, for a product. Every product must have exactly one default variant at all times.

Defaultfalse
thumbnail*string

URL to thumbnail. If not provided best-effort will be taken to resolve thumbnail url automatically

invalidThumbnail?boolean

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

externalId?string

Client defined product variant identifier

Lengthlength <= 255

Response 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
}
Empty
{
  "message": "Invalid request body",
  "type": "E_INVALID_BODY",
  "errors": [
    {
      "error": "\"email\" is required",
      "rule": "any.required",
      "field": "\"email\""
    }
  ]
}

How is this guide?

AiFI AI Chat

Beta

Powered by AiFi

Ask docs or API questions to get grounded answers.