Product Categories
- List all categories
 - Retrieve a category
 - Create a category
 - Update a category
 - Delete a category
 - Upload a category image
 - Delete a category image
 
List all categories
GET /api/v1/product_categoriesQuery parameters
| Name | Type | Description | 
|---|---|---|
fields | 
string | 
Comma-separated list of fields. Example id,parent_id,name | 
enabled | 
boolean | 
Only enabled categories | 
Retrieve a category
GET /api/v1/product_categories/{category_id}Create a category
POST /api/v1/product_categoriesRequest body
| Name | Type | Description | 
|---|---|---|
name | 
string | 
- | 
description | 
string | 
- | 
meta_description | 
string | 
- | 
meta_title | 
string | 
- | 
enabled | 
boolean | 
- | 
sort | 
string | 
- | 
parent_id | 
string | 
- | 
position | 
integer | 
- | 
slug | 
string | 
- | 
Update a category
PUT /api/v1/product_categories/{category_id}Request body
| Name | Type | Description | 
|---|---|---|
name | 
string | 
- | 
description | 
string | 
- | 
meta_description | 
string | 
- | 
meta_title | 
string | 
- | 
enabled | 
boolean | 
- | 
sort | 
string | 
- | 
parent_id | 
string | 
- | 
position | 
integer | 
- | 
slug | 
string | 
- | 
Delete a category
DELETE /api/v1/product_categories/{category_id}Upload a category image
POST /api/v1/product_categories/{category_id}/imageDelete a category image
DELETE /api/v1/product_categories/{category_id}/imageProducts
Products
Images of the product
Product options
Option values
Product variants
- List all product variants
 - Create a variant
 - Update a variant
 - Delete a variant
 - Set an option value to the product variant
 
List all products
GET /api/v1/productsQuery parameters
| Name | Type | Description | 
|---|---|---|
limit | 
integer | 
Default: 1000 | 
offset | 
integer | 
Default: 0 | 
category_id | 
string | 
- | 
ids | 
string | 
Comma-separated list of product ids | 
sku | 
string | 
Comma-separated list of product SKU | 
on_sale | 
boolean | 
- | 
stock_status | 
string | 
available, out_of_stock, preorder, backorder, discontinued | 
price_from | 
float | 
- | 
price_to | 
float | 
- | 
tags | 
string | 
Comma-separated list of product tags | 
attributes.<name> | 
string | 
Example: attributes.color=white | 
enabled | 
boolean | 
- | 
discontinued | 
boolean | 
- | 
fields | 
string | 
Comma-separated list of fields. Example id,parent_id,name | 
Create a product
POST /api/v1/productsRequest body
| Name | Type | Description | 
|---|---|---|
name | 
string | 
- | 
description | 
string | 
- | 
meta_description | 
string | 
- | 
meta_title | 
string | 
- | 
tags | 
array of string | 
- | 
attributes | 
array of object | 
- | 
enabled | 
boolean | 
- | 
discontinued | 
boolean | 
- | 
slug | 
string | 
- | 
sku | 
string | 
- | 
code | 
string | 
- | 
tax_class | 
string | 
- | 
related_product_ids | 
array of string | 
- | 
prices | 
array | 
- | 
cost_price | 
float | 
- | 
regular_price | 
float | 
- | 
sale_price | 
float | 
- | 
quantity_inc | 
integer | 
- | 
quantity_min | 
integer | 
- | 
weight | 
float | 
- | 
stock_quantity | 
integer | 
- | 
position | 
integer | 
- | 
date_stock_expected | 
date | 
- | 
date_sale_from | 
date | 
- | 
date_sale_to | 
date | 
- | 
stock_tracking | 
boolean | 
- | 
stock_preorder | 
boolean | 
- | 
stock_backorder | 
boolean | 
- | 
category_id | 
string | 
- | 
dimensions | 
object | 
Properties: 'length', 'width', 'height' | 
Retrieve a product
GET /api/v1/products/{product_id}Update a product
PUT /api/v1/products/{product_id}Delete a product
DELETE /api/v1/products/{product_id}List all images of the product
GET /api/v1/products/{product_id}/imagesUpload images to the product
POST /api/v1/products/{product_id}/imagesUpdate an image
PUT /api/v1/products/{product_id}/images/{image_id}Delete an image
DELETE /api/v1/products/{product_id}/images/{image_id}List all product options
GET /api/v1/products/{product_id}/optionsRetrieve an option
GET /api/v1/products/{product_id}/options/{option_id}Create an option
POST /api/v1/products/{product_id}/optionsUpdate an option
PUT /api/v1/products/{product_id}/options/{option_id}Delete an option
DELETE /api/v1/products/{product_id}/options/{option_id}List all values of the product option
GET /api/v1/products/{product_id}/options/{option_id}/valuesRetrieve a value
GET /api/v1/products/{product_id}/options/{option_id}/values/{value_id}Create a value
POST /api/v1/products/{product_id}/options/{option_id}/valuesUpdate a value
PUT /api/v1/products/{product_id}/options/{option_id}/values/{value_id}Delete a value
DELETE /api/v1/products/{product_id}/options/{option_id}/values/{value_id}List all product variants
GET /api/v1/products/{product_id}/variantsCreate a variant
POST /api/v1/products/{product_id}/variantsUpdate a variant
PUT /api/v1/products/{product_id}/variants/{variant_id}Delete a variant
DELETE /api/v1/products/{product_id}/variants/{variant_id}Set an option value to the product variant
PUT /api/v1/products/{product_id}/variants/{variant_id}/optionsCezerin API client library
Allows asynchronous requests to Cezerin REST API and get results with native Promise or async/await. Work on browser and server.
Client include:
- Cezerin API
 - Cezerin AJAX API
 - Cezerin Web Store API
 
Install with:
npm i cezerin-clientInitialize
import CezerinClient from 'cezerin-client';
const api = new CezerinClient({
  apiBaseUrl: 'https://website.com/api/v1',
  apiToken: '<token>'
});Usage
// fetch all categories with await
const categoriesResponse = await api.productCategories.list();
const categories = categoriesResponse.json;
for(const category of categories){
  console.log(category.name)
}
// fetch all categories with Promise
api.productCategories.list().then(({status, json}) => {
    const categories = json;
    for(const category of categories){
      console.log(category.name)
    }
});
// create a category
api.productCategories.create({name: 'Shoes', active: true}).then(({status, json}) => {
    const categoryId = json.id;
});Error Handling
// with await
try {
  const createResult = await api.productCategories.create({ name: 'Shoes' });
  const newCategory = createResult.json;
} catch(e) {
  console.log(e);
}
// with Promise
api.productCategories.create({ name: 'Shoes' })
.then(({status, json}) => {
  if(status === 200) {
    // success
    const newCategory = json;
  } else {
    // 404 or bad request
  }
})
.catch(err => {
  console.log(err)
});Methods
api.authorize(baseUrl, user, pass)api.sitemap.list()api.sitemap.retrieve(path)api.productCategories.list()api.productCategories.retrieve(id)api.productCategories.create(data)api.productCategories.update(id, data)api.productCategories.delete(id)api.productCategories.uploadImage(categoryId, formData)api.productCategories.deleteImage(id)- 
api.products.list({offset: 0,limit: 10,fields: 'id, name, price',category_id: '<id>',active: true,discontinued: false,search: '',on_sale: true,stock_status: 'available',price_from: 0,price_to: 100,sku: '',ids: '<id>,<id>,<id>',sort: 'regular_price,-stock_quantity'})
 api.products.retrieve(id)api.products.create(data)api.products.update(id, data)api.products.delete(id)api.products.skuExists(productId, sku)api.products.slugExists(productId, slug)api.products.options.list(productId)api.products.options.retrieve(productId, optionId)api.products.options.create(productId, data)api.products.options.update(productId, optionId, data)api.products.options.delete(productId, optionId)api.products.options.values.list(productId, optionId)api.products.options.values.retrieve(productId, optionId, valueId)api.products.options.values.create(productId, optionId, data)api.products.options.values.update(productId, optionId, valueId, data)api.products.options.values.delete(productId, optionId, valueId)api.products.variants.list(productId)api.products.variants.create(productId, data)api.products.variants.update(productId, variantId, data)api.products.variants.delete(productId, variantId)api.products.variants.setOption(productId, variantId, data)api.products.images.list(productId)api.products.images.update(productId, imageId, data)api.products.images.upload(productId, formData)api.products.images.delete(productId, imageId)api.theme.export()api.theme.install(formData)api.theme.settings.retrieve()api.theme.settings.update(settings)api.theme.settings.retrieveSchema()api.theme.assets.uploadFile(formData)api.theme.assets.deleteFile(fileName)api.customers.listapi.customers.retrieveapi.customers.createapi.customers.updateapi.customers.deleteapi.customers.createAddressapi.customers.updateAddressapi.customers.deleteAddressapi.customers.setDefaultBillingAddressapi.customers.setDefaultShippingAddressapi.customerGroups.listapi.customerGroups.retrieveapi.customerGroups.createapi.customerGroups.updateapi.customerGroups.deleteapi.orders.listapi.orders.retrieveapi.orders.createapi.orders.updateapi.orders.deleteapi.orders.checkoutapi.orders.recalculateapi.orders.cancelapi.orders.closeapi.orders.updateBillingAddressapi.orders.updateShippingAddressapi.orders.discounts.create(order_id, data)api.orders.discounts.update(order_id, discount_id, data)api.orders.discounts.delete(order_id, discount_id)api.orders.transactions.create(order_id, data)api.orders.transactions.update(customer_id, transaction_id, data)api.orders.transactions.delete(order_id, transaction_id)api.orders.items.create(order_id, data)api.orders.items.update(order_id, item_id, data)api.orders.items.delete(order_id, item_id)api.orderStatuses.listapi.orderStatuses.retrieveapi.orderStatuses.createapi.orderStatuses.updateapi.orderStatuses.deleteapi.shippingMethods.listapi.shippingMethods.retrieveapi.shippingMethods.createapi.shippingMethods.updateapi.shippingMethods.deleteapi.paymentMethods.listapi.paymentMethods.retrieveapi.paymentMethods.createapi.paymentMethods.updateapi.paymentMethods.deleteapi.paymentGateways.retrieveapi.paymentGateways.updateapi.settings.retrieveapi.settings.updateapi.settings.retrieveEmailSettingsapi.settings.updateEmailSettingsapi.settings.retrieveEmailTemplateapi.settings.updateEmailTemplateapi.checkoutFields.listapi.checkoutFields.retrieveapi.checkoutFields.updateapi.pages.listapi.pages.retrieveapi.pages.createapi.pages.updateapi.pages.deleteapi.tokens.listapi.tokens.retrieveapi.tokens.createapi.tokens.updateapi.tokens.deleteapi.redirects.listapi.redirects.retrieveapi.redirects.createapi.redirects.updateapi.redirects.deleteapi.files.list(filter)api.files.upload(formData)api.files.delete(fileName)api.webhooks.listapi.webhooks.retrieveapi.webhooks.createapi.webhooks.updateapi.webhooks.deleteapi.apps.settings.retrieve(appKey)api.apps.settings.update(appKey, data)api.theme.placeholders.list()api.theme.placeholders.retrieve(placeholderKey)api.theme.placeholders.create(data)api.theme.placeholders.update(placeholderKey, data)api.theme.placeholders.delete(placeholderKey)
Web Store Methods
api.webstore.init(token)api.webstore.authorize(email, admin_url)api.webstore.account.retrieve()api.webstore.account.update(data)api.webstore.account.updateDeveloper(data)api.webstore.services.list()api.webstore.services.retrieve(serviceId)api.webstore.services.settings.retrieve(serviceId)api.webstore.services.settings.update(serviceId, settings)api.webstore.services.actions.call(serviceId, actionId)api.webstore.services.logs.list(serviceId)