POST
Update product availability
- Path
/products/availability- Auth
- Secret key · server only
POST
/products/availability
const url = 'https://releva.ai/api/v0/products/availability';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"products":[{"id":"DEMO-1004","available":false}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://releva.ai/api/v0/products/availability \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "products": [ { "id": "DEMO-1004", "available": false } ] }'Changes only available (and updatedAt) on existing products. Every other stored field is left as it is.
For a product with a single variant, the variant’s availability follows. Ids that are not in the catalog
are skipped and no product is created. Asynchronous.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
products
required
Array<object>
object
id
required
The product id as sent to POST /products.
string
available
required
boolean
Example
{ "products": [ { "id": "DEMO-1004", "available": false } ]}Responses
Section titled “Responses”Accepted for asynchronous processing.
Media typeapplication/json
object
Example
{}Authentication or validation error.
Media typeapplication/json
object
message
required
Human-readable error. Several validation errors are joined with a space.
string
Examples
{ "message": "The object 'products[0]' contains forbidden keys: 'listPrice'."}{ "message": "The 'products[0].available' field must be a boolean."}The domain is disabled.
Media typeapplication/json
object
message
required
Human-readable error. Several validation errors are joined with a space.
string
Example
{ "message": "Domain is disabled. Please reach out to support@releva.ai to enable it."}Request body larger than 800 KB.
Media typeapplication/json
object
message
required
Human-readable error. Several validation errors are joined with a space.
string
Example
{ "message": "request entity too large"}Unexpected server error.
Media typeapplication/json
object
message
required
Human-readable error. Several validation errors are joined with a space.
string
Example
{ "message": "An internal error occurred."}