Products API

Manage WebKasa shop products and attach uploaded media as product images.

List Products

GET/api/v1/products

Retrieve products for the authenticated organization

Query Parameters

ParameterTypeDescription
statusstringFilter by product status, for example published or draft
searchstringSearch product names
min_pricenumberMinimum product price
max_pricenumberMaximum product price
in_stockbooleanOnly products available for purchase
limitnumberMax results
Default: 50
offsetnumberSkip results for pagination
Default: 0
Request
curl -X GET "https://api.webkasa.app/api/v1/products?status=published&in_stock=true" \
  -H "Authorization: Bearer wk_live_xxx..."

Create Product

POST/api/v1/products

Create a new shop product

Request Body

ParameterTypeDescription
name requiredstringProduct name
price requirednumberBase price in dollars
slugstringURL slug. Generated from name when omitted.
descriptionstringProduct description
featured_image_idstringMedia file ID to use as the featured image
statusstringProduct status
Default: draft
Request
curl -X POST "https://api.webkasa.app/api/v1/products" \
  -H "Authorization: Bearer wk_live_xxx..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Golden Jar",
    "price": 42,
    "description": "A handcrafted product",
    "featured_image_id": "media_abc123",
    "status": "published"
  }'

Response

201 Created
{
  "data": {
    "id": "prod_abc123",
    "name": "Golden Jar",
    "slug": "golden-jar",
    "price": 42,
    "featured_image_id": "media_abc123",
    "status": "published"
  }
}

List Product Images

GET/api/v1/products/{id}/images

Retrieve the product image gallery

Request
curl -X GET "https://api.webkasa.app/api/v1/products/prod_abc123/images" \
  -H "Authorization: Bearer wk_live_xxx..."

Attach Product Image

POST/api/v1/products/{id}/images

Attach an uploaded media file to a product

Request Body

ParameterTypeDescription
media_file_id requiredstringMedia file ID returned by POST /api/v1/media
is_featuredbooleanSet this media file as the product featured image
Default: false
order_indexnumberOptional image sort position. Defaults to the next position.
Request
curl -X POST "https://api.webkasa.app/api/v1/products/prod_abc123/images" \
  -H "Authorization: Bearer wk_live_xxx..." \
  -H "Content-Type: application/json" \
  -d '{
    "media_file_id": "media_abc123",
    "is_featured": true
  }'

Response

201 Created
{
  "data": {
    "id": "image_abc123",
    "product_id": "prod_abc123",
    "media_file_id": "media_abc123",
    "order_index": 0,
    "is_featured": true,
    "media_file": {
      "id": "media_abc123",
      "url": "https://...",
      "alt_text": "Golden jar product photo"
    }
  }
}
404 Not Found
{
  "error": "Media file not found"
}