TypeScript SDK
TypeScript / JavaScript
Installation
npm install @scell/sdkFeatures
- Full TypeScript typings (strict mode)
- Promise-based async/await API
- 4 client classes (Bearer, API Key, Tenant, Public)
- B2B + B2C invoices, credit notes, signatures, fiscal, webhooks
- Invoice Templates (upload logo + colors + mentions)
- Factur-X banking details (IBAN/BIC) + default payment terms
- Daily closure auto + email + CSV
- Nominative ISCA self-attestation (tenant + sub_tenant)
- Sandbox mode with sk_test_ prefix
- Online Stripe payment for Scell.io invoices (since v2.2.0)
- Sub-tenants management: ISCA-safe cascade delete + SuperPDP authorize URL (since v2.9.0)
- OpenTimestamps `ots_proof_base64` receipt on fiscal closings (since v2.10.0)
- Signature blocks: auto-paraphe + legal mentions + today date (since v2.12.0)
- Quotes: CRUD, send by email, signature, deposit/balance conversion (since v2.13.0)
- Full PaymentSchedule: set/patch/delete/summary/convertLine/presets (since v2.13.0)
- Quote `callback_url`: redirect buyer to tenant site after accept/refuse (since v2.13.1)
- `PaymentSummary.lines[]`: full visual tracker without extra request (since v2.14.0)
- invoices.update() / delete() + creditNotes.update() / delete() — draft only (since v2.16.0)
- Multi-page initials: `initials_block.positions[]` with per-page placement and style overrides (since v2.17.0)
- Webhook secret shown once at create / regenerate + `secret_last4` fingerprint (since v2.19.0)
- `parent_quote_id` on standard invoices: soft link to a source quote for traceability (since v2.21.0)
- `refunded` / `partially_refunded` statuses set automatically by the backend + `refund_status` and `total_refunded` fields exposed (since v2.22.0)
- Exhaustive enum coverage: 19 strict union types (`InvoiceType`, `QuoteStatus`, `VatCategory`, `SignatureStatus`, etc.) — no more generic `string` on the SDK surface (since v2.23.0)
- BT-81 Payment Means Code: Factur-X EN16931 compliance with 11 UN/ECE 4461 codes (since v2.25.0)
- Suppliers registry (`suppliers`): auto-populated from received invoices — GET + PATCH (email/phone/notes only); no manual create or delete (since v2.26.0 / v3.0.0)
- `InvoiceStatus` aligned with the backend 16 canonical statuses (since v2.27.1)
- Country company reference (`reference.countries()` / `.country(code)`): VAT, national registration ID (register + ISO 6523 scheme), legal forms — for country-aware buyer/seller forms (since v2.29.0)
- Micro-entrepreneur threshold monitoring (`subTenants.getThresholds`): VAT-franchise + micro-ceiling gauges, projected crossing date (dated rules, loi 2025-1044); VAT switch via `updateFiscalStatus` (since v2.30.0)
- Per-sub-tenant closing download (`fiscal.downloadClosing`, `closing_type`/`sub_tenant_id` filters) + per-sub-tenant FEC (since v2.30.0)
- Pre-issuance threshold simulator (`subTenants.simulateThresholds`): check a crossing BEFORE issuing an invoice (since v2.31.0)
- Explicit credit note contract: a partial credit note SELECTS invoice lines (`items[].invoice_line_id`), exact per-line VAT inherited (multi-rate); typed `remainingCreditable` (since v2.32.0)
- Forced SuperPDP disconnect / reconnect for a sub-tenant (`subTenants.superpdpDisconnect` / `superpdpReconnect`) + signed 24h token for the SuperPDP-only widget (`superpdpWidgetToken`) (since v3.1.0)
- Live HTML preview of a draft document (`documents.preview`), direct email logo upload (`branding.tenant.uploadLogoFile` / `branding.subTenants.uploadLogoFile`), non-persisted branding preview overrides (`branding.tenant.preview(overrides)`) and template color derivation from the logo (`invoiceTemplates.deriveColorsFromEmailLogo`) (since v3.2.0)
- Deposit groups (multi-invoice deals) `invoices.depositGroups()` / `depositGroup(id)`, legal-mentions assistant `invoiceMentions.assistant()` / `preview()`, wired quote payment schedule `quotes.paymentSchedule`, colors derived from the invoice logo `invoiceTemplates.deriveColorsFromInvoiceLogo()` + template preview `invoiceTemplates.preview()`; quote fixes `quotes.regeneratePublicLink` / `revokePublicLink` / `preview` (since v3.5.0)