Elmatajer · API docs
Products

Update stock by SKU

Sets the quantity of the product or variant that has this SKU — ideal for suppliers keeping stock in sync. Stock tracking is switched on.

PATCHhttps://elmatajer.com/api/v1/vendor/products/sku/{sku}/quantity
Permission: products.write

Path parameters

NameTypeRequiredDescription
skustringYesA product SKU or a variant SKU.

Request body

NameTypeRequiredDescription
quantityintegerYes0 or more.

Request

curl -X PATCH "https://elmatajer.com/api/v1/vendor/products/sku/TS-001-BL-L/quantity" \
  -H "Api-Key: YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"quantity":25}'

Response 200

{
    "status": "ok",
    "data": {
        "type": "variant",
        "id": 911,
        "product_id": 22900,
        "sku": "TS-001-BL-L",
        "quantity": 25
    }
}

A product whose stock lives on its variants answers 422 variant_stock — send the variant's SKU.