View Categories

Products Availability Update

3 min read

The products availability API lets you send bulk stock-status changes to Releva without re-sending the whole product. Use it for the high-frequency updates โ€” a product selling out, a product coming back in stock โ€” and the full Product Create / Update API for everything else.

Do I need to call it? #

Only if it makes your integration simpler. Everything this endpoint does can also be done by sending the complete product to the Product Create / Update API, and that is the only way to change a price, a name or any other attribute. This endpoint exists because availability changes far more often than the rest of a product, and sending a two-field payload for it is cheaper on both sides.

Availability changes sent here drive the same automations as a full product update โ€” back-in-stock and out-of-stock triggers fire exactly as they would otherwise.

Endpoint #

URL POST https://releva.ai/api/v0/products/availability
Authentication Authorization: Bearer <secretKey> โ€” the secret key of the domain whose catalog you are updating.
Content type application/json
Max request body 800 KB. Split larger updates into several requests.

Request Parameters #

You may perform requests to the API using the following curl equivalent:

curl -H 'Content-Type: application/json' -H 'Authorization: Bearer <secretKey>' -XPOST https://releva.ai/api/v0/products/availability -d'{
  "products": [
    {
      "id": "15",
      "available": true
    },
    {
      "id": "10",
      "available": false
    }
  ]
}'
Field Type Description
products[].id String The id of an existing product, exactly as you sent it to the Product Create / Update API โ€” including the locale and market suffix if your catalog uses one.
products[].available Boolean True if the product is available for sale, false otherwise.

Both fields are required, and they are the only fields this endpoint accepts. A product object carrying anything else โ€” a price, a name, a custom field โ€” is rejected with HTTP 400; send those through the Product Create / Update API instead.

What it changes, and what it does not #

  • Only availability changes. The product’s price, discount, name, description, categories, images, custom fields and variants are left exactly as they are.
  • Products are never created. An id that is not in your Releva catalog is accepted and ignored โ€” the request still answers 202. Use the Product Create / Update API to add a product.
  • Single-variant products have their one variant’s availability kept in step with the product. For a product with several variants this endpoint sets the product-level availability only; to change the availability of one variant, send the product with its full variants array to the Product Create / Update API.

Response Format #

A successful response will return HTTP Status 202 with an empty response body ({}).

An error response will return a HTTP 4xx or 5xx status code and have the following structure:

{
  "message": "A description of the error and how to fix it, if it's a client error."
}
Status Meaning
202 Accepted. The change will be live within 10 seconds. Ids that are not in the catalog are silently skipped.
400 The request body failed validation (a missing id or available, or a field this endpoint does not accept), or the Authorization header is missing, malformed or does not match a known domain. message names the offending field.
402 The domain is disabled. Please reach out to support@releva.ai to enable it.
413 The request body is larger than 800 KB. Send the updates in smaller batches.