Skip to main content
POST
/
api
/
v1
/
hub
/
shop
/
{shopId}
/
product
/
{productId}
/
variants
Create Product Variant
curl --request POST \
  --url https://api.sabivendor.com/api/v1/hub/shop/{shopId}/product/{productId}/variants \
  --header 'Content-Type: application/json' \
  --header 'X-Shop-API-Key: <x-shop-api-key>' \
  --data '
{
  "variantPrice": 123,
  "stockQuantity": 123,
  "options": "<string>"
}
'
{
  "status": "success",
  "message": "Variant created successfully",
  "data": {
    "variantId": 12,
    "variantPrice": 1250000,
    "stockQuantity": 30,
    "options": [
      {
        "optionTypeName": "Color",
        "optionValueName": "Red"
      },
      {
        "optionTypeName": "Size",
        "optionValueName": "42"
      }
    ]
  }
}
Adds a new SKU variant configuration to a product (e.g. Size: 44, Color: Blue) with variant-specific pricing, stock counts, and image uploads.

Authorizations

X-Shop-API-Key
string
required
Your Secret API Key (sk_live_... or sk_test_...) generated from the Developer dashboard. Must be kept secret.

Path Parameters

shopId
string
required
The unique UUID of the shop.
productId
number
required
The unique ID of the product.

Request Body (Multipart / Form Data)

variantPrice
number
required
Variant-specific price in Kobo. Must be greater than 0.
stockQuantity
number
required
Inventory count for this variant. Must be non-negative.
options
string
required
JSON array representing options. Example: [{"optionTypeName": "Color", "optionValueName": "Red"}].
{
  "status": "success",
  "message": "Variant created successfully",
  "data": {
    "variantId": 12,
    "variantPrice": 1250000,
    "stockQuantity": 30,
    "options": [
      {
        "optionTypeName": "Color",
        "optionValueName": "Red"
      },
      {
        "optionTypeName": "Size",
        "optionValueName": "42"
      }
    ]
  }
}