Working with Products
Learn how to create, list, update, and manage products through the API.
Overview
Products are the core of any Whatalo store. The Products API lets you manage your entire catalog programmatically — from creating single items to bulk updates.
List Products
Retrieve all products in your store with optional filtering and pagination.
curl -X GET https://api.whatalo.com/v1/products \
-H "X-API-Key: wk_live_your_key_here"Response:
{
"data": [
{
"id": "prod_abc123",
"name": "Premium T-Shirt",
"slug": "premium-t-shirt",
"description": "100% cotton premium quality",
"price": 2999,
"compare_price": 3999,
"product_status": "active",
"archived_at": null,
"stock_quantity": 150,
"created_at": "2026-01-15T10:30:00.000Z"
}
],
"pagination": { "page": 1, "per_page": 25, "total": 45, "total_pages": 2 }
}Required scope: read:products
Create a Product
curl -X POST https://api.whatalo.com/v1/products \
-H "X-API-Key: wk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "New Product",
"description": "A great product",
"price": 1999,
"product_status": "draft"
}'Required scope: write:products
Use product_status to create products as draft, active, or archived. Product responses use the same lifecycle values and include archived_at when a product is archived.
Update a Product
Update specific fields without affecting others:
curl -X PATCH https://api.whatalo.com/v1/products/prod_abc123 \
-H "X-API-Key: wk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"price": 2499,
"stock_quantity": 200,
"product_status": "active"
}'Required scope: write:products
To archive a product, update its lifecycle status:
curl -X PATCH https://api.whatalo.com/v1/products/prod_abc123 \
-H "X-API-Key: wk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"product_status": "archived"
}'Delete a Product
curl -X DELETE https://api.whatalo.com/v1/products/prod_abc123 \
-H "X-API-Key: wk_live_your_key_here"Required scope: write:products
Deleting a product is permanent and cannot be undone.
Get Product Count
Quickly check how many products exist without fetching all data:
curl -X GET https://api.whatalo.com/v1/products/count \
-H "X-API-Key: wk_live_your_key_here"Common Patterns
Bulk Price Update
To update prices for multiple products, iterate through your catalog:
const res = await fetch('https://api.whatalo.com/v1/products?per_page=100', {
headers: { 'X-API-Key': API_KEY }
});
const { data: products } = await res.json();
for (const product of products) {
const updateRes = await fetch(`https://api.whatalo.com/v1/products/${product.id}`, {
method: 'PATCH',
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
price: Math.round(product.price * 1.1) // 10% increase
})
});
if (!updateRes.ok) {
console.error(`Failed to update ${product.id}:`, await updateRes.json());
}
}For bulk operations, be mindful of the rate limit (1,000 requests/minute). Add a delay between requests if updating large catalogs.
Sync Inventory
Keep your inventory in sync with an external system:
async function syncInventory(externalProducts) {
for (const ext of externalProducts) {
const res = await fetch(`https://api.whatalo.com/v1/products/${ext.whataloId}`, {
method: 'PATCH',
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
stock_quantity: ext.stock
})
});
if (!res.ok) {
console.error(`Failed to sync ${ext.whataloId}:`, await res.json());
}
}
}