Skip to content

Area: Developers

Update product availability

POST /api/v0/products/availability changes available on products Releva already has, and nothing else.

Use it only if it makes your integration simpler. Availability changes far more often than the rest of a product, and this call lets you send just { id, available } instead of the whole product. Everything it does can also be done with Create or update products, which is the only way to change a price, a name or any other field.

A change of availability is recorded as an in-stock or out-of-stock catalog event, the same as through a full update, so back-in-stock and out-of-stock catalog triggers fire either way.

Send your shop’s Secret Key as a bearer token: authorization: Bearer $RELEVA_SECRET_KEY. Find it under Settings › Shop & Integration (Find your Access Token and Secret Key). The error messages are in Catalog API: Authentication.

POST https://releva.ai/api/v0/products/availability with content-type: application/json.

Field Type Required Notes
products array yes At least one entry.
products[].id string yes The stored product id, as sent to POST /products, including the locale and market suffix if your catalog uses one.
products[].available boolean yes true when the product can be bought.

No other key is allowed on an entry.

curl -X POST 'https://releva.ai/api/v0/products/availability' \
-H "authorization: Bearer $RELEVA_SECRET_KEY" \
-H 'content-type: application/json' \
-d '{
"products": [
{ "id": "DEMO-1001", "available": true },
{ "id": "DEMO-1002", "available": false }
]
}'

What changes:

  • Only available changes. Price, stock quantity, custom fields and everything else stay as they are.
  • A product stored with a single variant has that variant’s available changed too. Products with several variants keep their variants as they are: to change the availability of one variant, send the product with its full variants array to Create or update products.
  • An id that is not in the catalog is skipped. The call never creates a product.

202 Accepted with the body {}. The change is queued and usually visible within seconds.

Errors have one shape, { "message": "..." }.

Status When Message
400 Authentication failed See Catalog API: Authentication
400 Extra key listPrice The object 'products[0]' contains forbidden keys: 'listPrice'.
400 Missing available The 'products[0].available' field is required.
400 available: "false" (a string) The 'products[0].available' field must be a boolean.
402 Your shop is disabled Domain is disabled. Please reach out to support@releva.ai to enable it.
413 Body larger than 800 KB request entity too large
500 Unexpected error; retry later An internal error occurred.
  • Body size: 800 KB per request.
  • Rate limits: none.