Pulse Stock Update
Lightweight stock-only update for pulse variants. Designed for high-frequency inventory sync — updates stock_qty and in_stock without triggering re-embedding.
PATCH /v1/listings/pulse/stock/jsonl
Prerequisites
Pulse variants must already exist (ingested via POST /v1/listings/pulse/ingest/jsonl) before stock can be updated.
Request Headers
| Header | Required | Description |
|---|---|---|
tenant_id | Yes | Tenant identifier |
Content-Type | Yes | application/x-ndjson |
Request Body Format
Raw body — one JSON object per line. Maximum 10,000 rows per request.
Each line identifies a variant by listing_id + dimensions and applies the stock patch. dimensions must use the canonical key names defined in your tenant's pulse_config.dimension_fields.
When only stock_qty is provided, in_stock is auto-derived (stock_qty > 0).
Error Responses (400)
"tenant_id header is required""JSONL body must contain at least one non-empty line""Too many rows. Maximum: 10000, received: <n>""JSON parsing errors"— with per-line error details"Pulse row not found for given dimensions"— variant does not exist for the provided dimension combination
Parameters
listing_id
string
RequiredThe identifier of the listing whose stock is being updated. Must match an existing pulse-ingested listing.
dimensions
dictionary
RequiredKey-value pairs identifying the specific variant to update. Keys must match the canonical dimension_fields defined in your tenant's pulse config (e.g., branch_id, service_type).
stock_qty
integer
Updated stock quantity for this variant. When provided without in_stock, in_stock is auto-derived (stock_qty > 0 means in stock).
in_stock
boolean
Explicit in-stock flag. Overrides the auto-derived value when provided alongside stock_qty. At least one of stock_qty or in_stock must be present.
PATCH/v1/listings/pulse/stock/jsonl
bash
curl https://api-eu-aisearch.tradly.app/v1/listings/pulse/stock/jsonl \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR....." \
-H "Content-Type: application/json" \
-X PATCH \
-d '{"listing_id":"prod_123","dimensions":{"branch_id":"branch_A","service_type":"home_delivery"},"stock_qty":45,"in_stock":true}'RESPONSE
{
"success": true,
"total": 2,
"updated": 2,
"not_found": 0,
"errors": []
}