{"id":18594158,"url":"https://github.com/cezerin/client","last_synced_at":"2025-04-10T16:30:54.013Z","repository":{"id":52402405,"uuid":"72185524","full_name":"cezerin/client","owner":"cezerin","description":"JavaScript client for Cezerin REST API","archived":false,"fork":false,"pushed_at":"2021-05-12T21:43:22.000Z","size":196,"stargazers_count":22,"open_issues_count":5,"forks_count":25,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-18T11:31:52.363Z","etag":null,"topics":["api-client","e-commerce"],"latest_commit_sha":null,"homepage":"https://cezerin.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cezerin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-28T07:43:45.000Z","updated_at":"2024-08-14T20:30:49.000Z","dependencies_parsed_at":"2022-09-16T12:13:11.163Z","dependency_job_id":null,"html_url":"https://github.com/cezerin/client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cezerin%2Fclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cezerin%2Fclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cezerin%2Fclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cezerin%2Fclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cezerin","download_url":"https://codeload.github.com/cezerin/client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248070607,"owners_count":21042861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","e-commerce"],"created_at":"2024-11-07T01:14:39.346Z","updated_at":"2025-04-10T16:30:53.553Z","avatar_url":"https://github.com/cezerin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cezerin API client library\n\nAllows asynchronous requests to Cezerin REST API and get results with native Promise or async/await. Work on browser and server.\n\nClient include:\n- Cezerin API\n- Cezerin AJAX API\n- Cezerin Web Store API\n\n\nInstall with:\n\n```\nnpm i cezerin-client\n```\n\n\n## Initialize\n\n```javascript\nimport CezerinClient from 'cezerin-client';\n\nconst api = new CezerinClient({\n  apiBaseUrl: 'https://website.com/api/v1',\n  apiToken: '\u003ctoken\u003e'\n});\n```\n\n## Usage\n\n```javascript\n// fetch all categories with await\nconst categoriesResponse = await api.productCategories.list();\nconst categories = categoriesResponse.json;\nfor(const category of categories){\n  console.log(category.name)\n}\n\n// fetch all categories with Promise\napi.productCategories.list().then(({status, json}) =\u003e {\n    const categories = json;\n    for(const category of categories){\n      console.log(category.name)\n    }\n});\n\n// create a category\napi.productCategories.create({name: 'Shoes', active: true}).then(({status, json}) =\u003e {\n    const categoryId = json.id;\n});\n```\n\n##  Error Handling\n\n```javascript\n// with await\ntry {\n  const createResult = await api.productCategories.create({ name: 'Shoes' });\n  const newCategory = createResult.json;\n} catch(e) {\n  console.log(e);\n}\n\n// with Promise\napi.productCategories.create({ name: 'Shoes' })\n.then(({status, json}) =\u003e {\n  if(status === 200) {\n    // success\n    const newCategory = json;\n  } else {\n    // 404 or bad request\n  }\n})\n.catch(err =\u003e {\n  console.log(err)\n});\n```\n\n## Methods\n\n* `api.authorize(baseUrl, user, pass)`\n* `api.sitemap.list()`\n* `api.sitemap.retrieve(path)`\n* `api.productCategories.list()`\n* `api.productCategories.retrieve(id)`\n* `api.productCategories.create(data)`\n* `api.productCategories.update(id, data)`\n* `api.productCategories.delete(id)`\n* `api.productCategories.uploadImage(categoryId, formData)`\n* `api.productCategories.deleteImage(id)`\n* `api.products.list({`\n    - `offset: 0,`\n    - `limit: 10,`\n    - `fields: 'id, name, price',`\n    - `category_id: '\u003cid\u003e',`\n    - `active: true,`\n    - `discontinued: false,`\n    - `search: '',`\n    - `on_sale: true,`\n    - `stock_status: 'available',`\n    - `price_from: 0,`\n    - `price_to: 100,`\n    - `sku: '',`\n    - `ids: '\u003cid\u003e,\u003cid\u003e,\u003cid\u003e',`\n    - `sort: 'regular_price,-stock_quantity'})`\n* `api.products.retrieve(id)`\n* `api.products.create(data)`\n* `api.products.update(id, data)`\n* `api.products.delete(id)`\n* `api.products.skuExists(productId, sku)`\n* `api.products.slugExists(productId, slug)`\n* `api.products.options.list(productId)`\n* `api.products.options.retrieve(productId, optionId)`\n* `api.products.options.create(productId, data)`\n* `api.products.options.update(productId, optionId, data)`\n* `api.products.options.delete(productId, optionId)`\n* `api.products.options.values.list(productId, optionId)`\n* `api.products.options.values.retrieve(productId, optionId, valueId)`\n* `api.products.options.values.create(productId, optionId, data)`\n* `api.products.options.values.update(productId, optionId, valueId, data)`\n* `api.products.options.values.delete(productId, optionId, valueId)`\n* `api.products.variants.list(productId)`\n* `api.products.variants.create(productId, data)`\n* `api.products.variants.update(productId, variantId, data)`\n* `api.products.variants.delete(productId, variantId)`\n* `api.products.variants.setOption(productId, variantId, data)`\n* `api.products.images.list(productId)`\n* `api.products.images.update(productId, imageId, data)`\n* `api.products.images.upload(productId, formData)`\n* `api.products.images.delete(productId, imageId)`\n* `api.theme.export()`\n* `api.theme.install(formData)`\n* `api.theme.settings.retrieve()`\n* `api.theme.settings.update(settings)`\n* `api.theme.settings.retrieveSchema()`\n* `api.theme.assets.uploadFile(formData)`\n* `api.theme.assets.deleteFile(fileName)`\n* `api.customers.list`\n* `api.customers.retrieve`\n* `api.customers.create`\n* `api.customers.update`\n* `api.customers.delete`\n* `api.customers.createAddress`\n* `api.customers.updateAddress`\n* `api.customers.deleteAddress`\n* `api.customers.setDefaultBillingAddress`\n* `api.customers.setDefaultShippingAddress`\n* `api.customerGroups.list`\n* `api.customerGroups.retrieve`\n* `api.customerGroups.create`\n* `api.customerGroups.update`\n* `api.customerGroups.delete`\n* `api.orders.list`\n* `api.orders.retrieve`\n* `api.orders.create`\n* `api.orders.update`\n* `api.orders.delete`\n* `api.orders.checkout`\n* `api.orders.recalculate`\n* `api.orders.cancel`\n* `api.orders.close`\n* `api.orders.updateBillingAddress`\n* `api.orders.updateShippingAddress`\n* `api.orders.discounts.create(order_id, data)`\n* `api.orders.discounts.update(order_id, discount_id, data)`\n* `api.orders.discounts.delete(order_id, discount_id)`\n* `api.orders.transactions.create(order_id, data)`\n* `api.orders.transactions.update(customer_id, transaction_id, data)`\n* `api.orders.transactions.delete(order_id, transaction_id)`\n* `api.orders.items.create(order_id, data)`\n* `api.orders.items.update(order_id, item_id, data)`\n* `api.orders.items.delete(order_id, item_id)`\n* `api.orderStatuses.list`\n* `api.orderStatuses.retrieve`\n* `api.orderStatuses.create`\n* `api.orderStatuses.update`\n* `api.orderStatuses.delete`\n* `api.shippingMethods.list`\n* `api.shippingMethods.retrieve`\n* `api.shippingMethods.create`\n* `api.shippingMethods.update`\n* `api.shippingMethods.delete`\n* `api.paymentMethods.list`\n* `api.paymentMethods.retrieve`\n* `api.paymentMethods.create`\n* `api.paymentMethods.update`\n* `api.paymentMethods.delete`\n* `api.paymentGateways.retrieve`\n* `api.paymentGateways.update`\n* `api.settings.retrieve`\n* `api.settings.update`\n* `api.settings.retrieveEmailSettings`\n* `api.settings.updateEmailSettings`\n* `api.settings.retrieveEmailTemplate`\n* `api.settings.updateEmailTemplate`\n* `api.checkoutFields.list`\n* `api.checkoutFields.retrieve`\n* `api.checkoutFields.update`\n* `api.pages.list`\n* `api.pages.retrieve`\n* `api.pages.create`\n* `api.pages.update`\n* `api.pages.delete`\n* `api.tokens.list`\n* `api.tokens.retrieve`\n* `api.tokens.create`\n* `api.tokens.update`\n* `api.tokens.delete`\n* `api.redirects.list`\n* `api.redirects.retrieve`\n* `api.redirects.create`\n* `api.redirects.update`\n* `api.redirects.delete`\n* `api.files.list(filter)`\n* `api.files.upload(formData)`\n* `api.files.delete(fileName)`\n* `api.webhooks.list`\n* `api.webhooks.retrieve`\n* `api.webhooks.create`\n* `api.webhooks.update`\n* `api.webhooks.delete`\n* `api.apps.settings.retrieve(appKey)`\n* `api.apps.settings.update(appKey, data)`\n* `api.theme.placeholders.list()`\n* `api.theme.placeholders.retrieve(placeholderKey)`\n* `api.theme.placeholders.create(data)`\n* `api.theme.placeholders.update(placeholderKey, data)`\n* `api.theme.placeholders.delete(placeholderKey)`\n\n## Web Store Methods\n\n* `api.webstore.init(token)`\n* `api.webstore.authorize(email, admin_url)`\n* `api.webstore.account.retrieve()`\n* `api.webstore.account.update(data)`\n* `api.webstore.account.updateDeveloper(data)`\n* `api.webstore.services.list()`\n* `api.webstore.services.retrieve(serviceId)`\n* `api.webstore.services.settings.retrieve(serviceId)`\n* `api.webstore.services.settings.update(serviceId, settings)`\n* `api.webstore.services.actions.call(serviceId, actionId)`\n* `api.webstore.services.logs.list(serviceId)`\n\n\n## Contributing\n\nIf you can, please contribute by reporting issues, discussing ideas, or submitting pull requests with patches and new features. We do our best to respond to all issues and pull requests within a day or two, and make patch releases to npm regularly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcezerin%2Fclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcezerin%2Fclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcezerin%2Fclient/lists"}