Skip to main content

Use cases

Multi-tenant invoicing (B2B2B architecture)

One SSII tenant, N end-client sub-tenants

Scell.io exposes two isolation levels: the tenant (SaaS/SSII partner account) and sub-tenants (the partner's end clients). Each sub-tenant has its own invoice numbering, PDF templates and ISCA-compliant numbering series. The parent tenant uses its `sk_live_*` key and passes `sub_tenant_id` on every invoice creation request. Data is strictly isolated at DB level via `tenant_id`/`sub_tenant_id`. Ideal for French SSIIs reselling an e-invoicing layer to their own clients under a single Scell.io contract.

Key facts

  • 1 parent `sk_live_*` key, N child sub-tenants
  • Independent invoice numbering per sub-tenant
  • PDF templates (logo, colours) per sub-tenant
  • `sub_tenant_id` in request body (recommended; `X-Sub-Tenant-Id` header accepted as a legacy alias)
  • Webhooks routed to parent tenant with `sub_tenant_id` in payload
  • Balance shared at parent-tenant level (centralised billing)

Code example

import { ScellClient } from '@scell/sdk';
const scell = new ScellClient({ apiKey: process.env.SCELL_SECRET_KEY! });

// 1. Créer un sub-tenant pour un client final
const subTenant = await scell.subTenants.create({
  name: 'Boulangerie Dupont SARL',
  legal_id: '12345678901234',
  invoice_numbering_prefix: 'BD',
});

// 2. Émettre une facture au nom de ce sub-tenant
const invoice = await scell.invoices.create({
  sub_tenant_id: subTenant.id,
  format: 'factur-x',
  buyer: { siret: '98765432109876', name: 'Client Final SAS' },
  lines: [{ description: 'Prestation', quantity: 1, unit_price: 1000, vat_rate: 20 }],
});

See also

Your cookie preferences

We use cookies to improve your experience. Essential cookies are always active. Cookie policy.