Skip to content

About

TypeScript SDK for the Selldone Backoffice API: build custom dashboards, ERP integrations and shop management tools for Selldone shops.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

2 watching

Forks

Repository files navigation

Selldone Backoffice SDK — build custom dashboards, ERP bridges and automation on top of the Selldone back-office API

npm downloads License Docs Selldone

The admin API client for Selldone shops: build custom dashboards, ERP bridges and shop-management tools on top of the Selldone Backoffice API.
Documentation · Quick start · Ecosystem · Selldone.com · Report an issue

Storefront · Page Builder · Components · Storefront SDK · Backoffice SDK · Vendor SDK · Community SDK · Core · CLI · Translate

Overview

Backoffice SDK (@selldone/sdk-backoffice) is the TypeScript client for the admin side of Selldone® Business OS. It wraps the Backoffice API (https://api.selldone.com) that powers the Selldone dashboard: products, variants, categories, inventory imports, pages, blogs, vendors, logistic profiles, agencies and more.

The SDK has two layers. window.API is a catalog of URL builders, one per backend route, each annotated with its HTTP method, auth requirement and token scope. window.$backoffice groups typed request wrappers by domain (product, category, vendor, agency, …) and adds response caching and request cancellation on top of Axios.

Use it when you build a custom management dashboard, an internal tool, or a browser-based integration for one or more Selldone shops. If you integrate from a server (ERP, PIM, warehouse system), you can call the same REST endpoints directly with any HTTP client; this repository's wiki documents both paths.

Key features

  • One global entry point — BackofficeSDK.Setup() registers window.$backoffice with 13 namespaces: auth, user, page, product, category, blog, vendor, agency, article, logistic, map, affiliate, finance.
  • Complete URL catalog — apis/API.ts contains over a thousand URL builders. Each one documents its endpoint, HTTP method, auth middleware, token scope and known errors.
  • Typed requests and responses — every wrapper declares an IResponse interface (and IParams for its options) built on the shared models in @selldone/core-js.
  • Built-in caching and cancellation — chain .optimize(seconds), .force() or .cancellation() on any namespace, and .cache(callback) on GET requests, to render cached data instantly and drop stale responses.
  • Product operations — list and filter products, read full admin details, set stock, move products between categories, tag products, remove or restore variants, and remove AR models.
  • Bulk import pipeline — send a spreadsheet-style dataset to the product importer, then inspect and retry the product and image queues.
  • Marketplace and agency tools — list vendors and vendor offers, and manage agency shops, clients and wallets.
  • Dashboard guideline pack — ai-guideline/ maps every Backoffice module to routes, permissions and full endpoint URLs so you can rebuild the dashboard in any framework.

Quick start

1. Install

npm install @selldone/sdk-backoffice
yarn add @selldone/sdk-backoffice

The package depends on @selldone/core-js, axios and lodash-es.

2. Configure the API endpoints

The SDK reads its configuration from <meta> tags in the page head (or from window.selldone_config):

<meta name="service-url" content="https://selldone.com">
<meta name="selldone-api" content="https://api.selldone.com">

3. Initialize and make your first call

import { SelldoneCore } from "@selldone/core-js";
import { BackofficeSDK } from "@selldone/sdk-backoffice";

// Selldone Core must be initialized first. The Backoffice SDK checks for it.
SelldoneCore.Setup();

// ━━━ Backoffice SDK (api,...) ━━━
BackofficeSDK.Setup(); // Registers window.API and window.$backoffice

// Outside the Selldone dashboard, authenticate with your access token.
window.axios.defaults.headers.common["Authorization"] = `Bearer ${ACCESS_TOKEN}`;

const { products, total } = await window.$backoffice.product.list(SHOP_ID, 0, 20, {
  products_only: true,
  with_total: true,
});

await window.$backoffice.product.setQuantity(SHOP_ID, products[0].id, 120);

Get an access token from the developer panel or with the ERP Bridge link described in Access Token.

Usage

Two ways to integrate

Path Best for Start here
REST API (https://api.selldone.com) Servers, ERPs, scripts, any language Fast Start
JavaScript SDK (window.$backoffice) Browser dashboards and admin tools JavaScript SDK

The window.$backoffice namespaces

Namespace Main methods Backend routes
auth logout() POST /logout-selldone
user preferences.save(preferences) PUT /preferences
page list(), getPageAugment() /shops/{shop_id}/pages
product list(), getInfo(), setQuantity(), changeCategory(), importer.*, tags.set(), variants.*, ar.remove(), vendor.list(), subscriptionPricing.list() /shops/{shop_id}/products/..., /shops/{shop_id}/import/...
category list() GET /shops/{shop_id}/categories
blog list(), categories.list/add/edit/remove() /shops/{shop_id}/blogs, /shops/{shop_id}/blog/categories
vendor list() GET /shops/{shop_id}/vendors
agency getInfo(), shops.add/list(), clients.list(), wallet.* /agencies/{agency_id}/...
article tags.getTags/setArticleTags/updateTag() /shops/{shop_id}/articles/tags
logistic profile.list(), profile.get() /shops/{shop_id}/logistic-profiles
map tag.list() GET /shops/{shop_id}/map/tags
affiliate pos.list() GET /affiliates/{affiliate_id}/products
finance exchange.list() GET /exchange/rates

Every method returns a promise. List methods follow the (id, offset, limit, options) signature. The full reference, with parameters and response fields, is on the JavaScript SDK wiki page.

Caching and cancellation

The request classes extend APIAbstract from Selldone Core:

window.$backoffice.product
  .optimize(60)       // reuse a cached response younger than 60 seconds
  .cancellation()     // cancel a pending request to the same URL
  .list(SHOP_ID, 0, 20, { search: "mug" })
  .cache((data) => render(data)) // called first with cached data, if any
  .then((data) => render(data))
  .catch((error) => console.error(error));

A promise rejects with the server's error body ({ error: true, error_msg, code }) when the API reports an error, or with an Axios error for network and HTTP failures.

Dashboard API rate limits

Dashboard API calls through api.{domain} are rate limited to protect the shared backoffice API.

API surface Current limit
api.{domain} dashboard API routes 80 requests per 1 minute

Some routes have their own, stricter limits. See Rate Limits.

Build a complete custom dashboard

The ai-guideline/ folder is a source-derived guide for rebuilding the full Selldone Backoffice in any frontend framework, for developers and coding agents alike. It contains the module inventory, route model, permission regions, UI patterns, and generated catalogs of every endpoint used by the dashboard (_generated/api-url-builders.md). Start with 00-ai-agent-entrypoint.md, or read the summary on the Building a Custom Dashboard wiki page.

Documentation

Page What you'll learn
Getting Started Install, configure and make your first SDK and REST calls
Fast Start Sync products and inventory with the REST API in five minutes
Access Token Personal tokens, OAuth2, ERP Bridge, Connect Bridge and the full scope list
JavaScript SDK Every window.$backoffice namespace, method and response
Rate Limits Request budgets and how to stay within them
Fetch Products List Filters, sorting and pagination for product lists
Edit Product Update product fields, pricing and shipping settings
Edit Product's Variant Full variant edit, price-only and quantity-only updates
Add Images to Products/Variants Upload main, gallery and per-variant images
Upload Products Category Image Set a category image
Get Vendors List List marketplace vendors
Vendor Products List Read vendor-specific offers for a product
Vendor Product Add · Update · Delete Manage vendor offers as the marketplace owner
Building a Custom Dashboard Use the dashboard guideline pack
FAQ Common questions and troubleshooting

How it fits in the ecosystem

The Backoffice SDK is the admin-side counterpart of the Storefront SDK. It builds on Selldone Core for models, enums and the HTTP base class, and it powers the backoffice widgets in Components. Marketplace vendors use the Vendor SDK, which mirrors the product APIs for a single vendor.

Selldone open-source ecosystem

Related project Why you'd use it
Core Shared models, enums and helpers used by every SDK (required)
Components Ready-made Vue 3 backoffice widgets that call this SDK
Vendor SDK Build the vendor panel of a multi-vendor marketplace
ERP Guide and demos for connecting ERP software to Selldone orders
Sample Connect Provider Embed your service into Selldone with the Connect Bridge
Clone Sheet Clone shop data into MariaDB/MySQL

Contributing

Contributions are welcome. Please read the organization contributing guide and code of conduct.

Development notes for this package:

  • The package is published as TypeScript source (main is index.ts).
  • npm run build and npm run clean call tsc directly and write or delete .js and .js.map files next to the sources. Do not run them while a linked development server is watching this package. See AGENT.md.
  • New endpoints belong in apis/API.ts as URL builders; typed wrappers live in the folder of their namespace (for example product/requests/).

Security

Please do not report vulnerabilities in public issues. Email security@selldone.com. See the organization security policy.

Access tokens grant access to shop data. Keep them out of public repositories and public client-side bundles, and request only the scopes your integration needs.

License

See LICENSE.md.

Selldone Ecosystem License Agreement
  1. Scope of License: This license is granted exclusively for the use of the enclosed code (hereinafter referred to as "the Code") within the Selldone ecosystem. The licensee is authorized to use the Code solely in conjunction with services and applications that are part of, or directly related to, the Selldone ecosystem.

  2. Commercial Use Restriction: The licensee is strictly prohibited from using the Code for any commercial purposes outside the Selldone ecosystem. Commercial utilization is permissible only when it is within the Selldone ecosystem and in accordance with the terms of this agreement.

  3. Permission for Free Use: The Code may be used for non-commercial, free services, provided that explicit credit is given to Selldone. This credit must include the name "Selldone" prominently displayed on the user interface of the relevant service or application, along with a hyperlink to selldone.com.

  4. No Redistribution: The licensee may not redistribute the Code, in whole or in part, to any third party outside the Selldone ecosystem, unless expressly authorized by Selldone.

  5. No Modification for Redistribution: While modifications to the Code for personal or internal use within the Selldone ecosystem are allowed, the licensee may not modify the Code for the purpose of redistribution outside the Selldone ecosystem.

  6. Termination: Failure to comply with the terms of this agreement will result in the immediate termination of the license and may subject the licensee to legal action.

  7. Disclaimer of Warranty: The Code is provided "as is" without any warranties of any kind, either expressed or implied, including but not limited to implied warranties of merchantability or fitness for a particular purpose.

  8. Limitation of Liability: In no event shall Selldone be liable for any damages arising out of the use or inability to use the Code.

  9. Jurisdiction and Disputes: This agreement shall be governed by the laws of the jurisdiction where Selldone is established. Any disputes arising from this agreement shall be resolved in the courts of that jurisdiction.

By using the Code, the licensee acknowledges that they have read, understood, and agreed to the terms of this license.


Part of the Selldone® Business OS open-source ecosystem · selldone.com

About

TypeScript SDK for the Selldone Backoffice API: build custom dashboards, ERP integrations and shop management tools for Selldone shops.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages