Catalogue
The catalogue holds only products that are active and have Show on your website turned on in Sabiwave. A product you hide disappears from these answers at once.
List products
Section titled “List products”GET/catalog/products
Products on your website, oldest first, a page at a time.
| Query | Meaning |
|---|---|
limit |
1 to 100. Default 20. |
cursor |
nextCursor from the previous page. |
categoryId |
Only products in this category. |
search |
Only products whose name contains this, in any case. Up to 100 characters. |
minPrice |
Only products priced at least this much, in major units. |
maxPrice |
Only products priced at most this much, in major units. |
curl "https://api.sabiwave.com/api/v1/public/catalog/products?limit=20" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY"const res = await fetch('https://api.sabiwave.com/api/v1/public/catalog/products?limit=20', { headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, },});const result = await res.json();{ "success": true, "data": { "products": [ { "id": "01a2160c-6b00-7627-af42-d534badeaea4", "name": "Weekend Gift Hamper", "slug": "weekend-gift-hamper", "description": "A weekend of treats in a woven basket: biscuits, chocolate, juice and a card.", "price": 20000, "category": { "id": "01a22538-d1f7-765d-8fbb-efd7afcc9459", "name": "Hampers" }, "images": [], "inStock": true, "stockLevel": "low_stock", "variants": [], "seo": { "title": null, "description": null } } ], "nextCursor": null }}Filters combine:
curl "https://api.sabiwave.com/api/v1/public/catalog/products?search=weekend&maxPrice=30000&limit=10" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY"const res = await fetch('https://api.sabiwave.com/api/v1/public/catalog/products?search=weekend&maxPrice=30000&limit=10', { headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, },});const result = await res.json();A product
Section titled “A product”| Field | Meaning |
|---|---|
id |
The product’s id: send it as productId in orders and promo checks. |
name |
Its name. |
slug |
A web-friendly name, unique in your business: use it in your page addresses. |
description |
Its website description, written in the product’s Website description in Sabiwave, or null until one is. The product’s other description is for your team and never shown here. |
price |
Its price, in major units of your currency. |
category |
{ id, name }, or null. |
images |
Up to 8 pictures, in your order: each { url, thumbnailUrl }. |
inStock |
false when there’s none left in the store your website sells from. |
stockLevel |
in_stock, low_stock or out_of_stock. |
variants |
Each { id, name, options, price, inStock, stockLevel }, where options is what makes it that variant, such as { "Colour": "Red", "Size": "L" }. Send the variant’s id as variantId in orders. |
seo |
{ title, description } for your page’s title and meta description, each possibly null. |
Stock is the stock of the store your website sells from, your first open store, which is where a
website order takes it: what shows as in stock is what an order can have. stockLevel is
out_of_stock when none is left there, and low_stock when what’s left is at or below the
product’s reorder point in that store, or 5 where none is set, as your dashboard counts it. A
product with variants adds its variants up; a combo counts the sets its contents make; a service is
never out. The exact count isn’t shown: it’s competitive information. Your server can read it with
GET /inventory.
Get a product
Section titled “Get a product”GET/catalog/products/{idOrSlug}
One product, by its id or its slug, with the same fields as in the list. A product that isn’t
on your website answers 404 PRODUCT_NOT_FOUND, as if it didn’t exist.
curl "https://api.sabiwave.com/api/v1/public/catalog/products/weekend-gift-hamper" \ -H "X-Sabiwave-Public-Key: $SABIWAVE_PUBLISHABLE_KEY" \ -H "Origin: https://shop.example.com"// In the browser. The publishable key is safe in your page.const SABIWAVE_PUBLISHABLE_KEY = 'pk_live_…';
const res = await fetch('https://api.sabiwave.com/api/v1/public/catalog/products/weekend-gift-hamper', { headers: { 'X-Sabiwave-Public-Key': SABIWAVE_PUBLISHABLE_KEY, },});const result = await res.json();{ "success": true, "data": { "product": { "id": "01a2160c-6b00-7627-af42-d534badeaea4", "name": "Weekend Gift Hamper", "slug": "weekend-gift-hamper", "description": "A weekend of treats in a woven basket: biscuits, chocolate, juice and a card.", "price": 20000, "category": { "id": "01a22538-d1f7-765d-8fbb-efd7afcc9459", "name": "Hampers" }, "images": [], "inStock": true, "stockLevel": "low_stock", "variants": [], "seo": { "title": null, "description": null } } }}{ "success": false, "message": "We could not find that product.", "error": { "name": "NotFoundError", "code": "PRODUCT_NOT_FOUND", "statusCode": 404 }, "requestId": "18da2bed-284c-423b-8d4d-eb7de737c1cd"}List categories
Section titled “List categories”GET/catalog/categories
Active categories with at least one product on your website, in your order. Not paginated.
curl "https://api.sabiwave.com/api/v1/public/catalog/categories" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY"const res = await fetch('https://api.sabiwave.com/api/v1/public/catalog/categories', { headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, },});const result = await res.json();{ "success": true, "data": { "categories": [ { "id": "01a22538-d1f7-765d-8fbb-efd7afcc9459", "name": "Hampers", "description": "Gift hampers for every occasion.", "imageUrl": null } ] }}| Field | Meaning |
|---|---|
id |
Use it as categoryId when listing products. |
name |
Its name. |
description |
Its description, or null. |
imageUrl |
Its picture, or null. |