Back

    Buyamia Directory API

    v1.0

    Update Product

    PUT
    /v1/products/:id

    Update an existing product. Only include fields you want to change.

    products.write

    Requires the products.write permission scope.

    Updatable Fields

    FieldTypeDescription
    namestringProduct name
    descriptionstringProduct description
    base_pricenumberBase unit price
    currencystringCurrency code
    unit_of_measurestringUnit of measure
    skustringSKU / part number
    category_iduuidProduct category
    imagesstring[]Image URLs (replaces existing array)
    is_availablebooleanAvailability flag
    specificationsobjectSpecifications (replaces existing object)
    moqintegerMinimum order quantity
    statusstringProduct status: active, draft, or archived

    Fires product.updated webhook with updated_fields array. If base_price changes, also fires product.price_changed.

    Example Request

    Update Price & Availabilitybash
    curl -X PUT "https://rjpxllsycikfabazvkdh.supabase.co/functions/v1/directory-api/v1/products/prod-uuid" \
      -H "X-API-Key: your-key" \
      -H "Content-Type: application/json" \
      -d '{
        "base_price": 5200000,
        "is_available": true,
        "moq": 5
      }'

    Response

    {
      "data": {
        "id": "prod-uuid",
        "name": "Executive Standing Desk",
        "base_price": 5200000,
        "is_available": true,
        "moq": 5,
        "updated_at": "2026-03-15T10:30:00Z"
      }
    }
    Last updated on March 15, 2026