update_commerce_inventory
Set or adjust stock for one variant.
Use quantity for an absolute level, or delta to add/subtract (negative allowed). Stock never goes below zero. Products without variations use variant_id "default".
Args: project_id: The project ID. product_id: The product ID. variant_id: The variant ID. Use "default" for products with no variations. quantity: Absolute stock level. Takes precedence over delta. Leave -1 to use delta. delta: Relative change, e.g. -3 to remove three units. Must be non-zero when quantity is -1.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| delta | No | ||
| quantity | No | ||
| product_id | Yes | ||
| project_id | Yes | ||
| variant_id | No | default |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |