Skip to main content
PUT
/
api
/
v1
/
hub
/
shop
/
{shopId}
/
product
/
{productId}
Update Product
curl --request PUT \
  --url https://api.sabivendor.com/api/v1/hub/shop/{shopId}/product/{productId} \
  --header 'Content-Type: application/json' \
  --header 'X-Shop-API-Key: <x-shop-api-key>' \
  --data '
{
  "productName": "<string>",
  "productPrice": 123,
  "productQuantity": 123,
  "isDiscountActive": true,
  "discountType": "<string>",
  "discountValue": 123,
  "oldMedia": "<string>"
}
'
{
  "status": "success",
  "message": "Product updated successfully",
  "data": {
    "id": 101,
    "productName": "Premium Running Shoes",
    "productPrice": 1400000,
    "stockQuantity": 95,
    "isActive": true
  }
}
Updates details, pricing, discount logic, or media of an existing product. Supports:
  1. Partial updates (pass only fields to change).
  2. Uploading new images (newMedia) while keeping/reordering old ones (oldMedia).
  3. Validates total images do not exceed 6.
  4. Enforces discount type rules (percent discount cannot exceed 100%).

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)

productName
string
Name of the product.
productPrice
number
Updated price in Kobo.
productQuantity
number
Updated inventory stock.
isDiscountActive
boolean
Activate discount pricing.
discountType
string
Discount format: percent or fixed.
discountValue
number
Discount value.
oldMedia
string
JSON array string representing remaining existing images.
newMedia
file
New image files to upload.
{
  "status": "success",
  "message": "Product updated successfully",
  "data": {
    "id": 101,
    "productName": "Premium Running Shoes",
    "productPrice": 1400000,
    "stockQuantity": 95,
    "isActive": true
  }
}