libraryPackage manifestv4.0.4

lib.billing-spec

Country-neutral BillingOS quote-to-cash contracts, invariants, and agent action governance types.

@lssm-tech/lib.billing-spec
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 4.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
servernode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.billing-specdomains

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

3 declarationsSELECT TO INSPECT

@lssm-tech/lib.billing-spec

Country-neutral BillingOS contracts for quote-to-cash primitives, lifecycle evidence, policy metadata, and agent-facing operation descriptions.

This package is the canonical core contract surface. It intentionally does not contain France-only readiness, PA routing, provider credentials, production submission APIs, persistence adapters, UI, or runtime side effects.

Scope

Use this package to model reusable BillingOS concepts before choosing a country pack or runtime implementation:

  • commercial parties, billing accounts, seller/buyer/vendor/customer roles, and fiscal references;
  • catalog, price book, offer, quote, order/commitment, invoice, credit-note, payment, reconciliation, and tax-treatment references;
  • workflow/event/audit/source metadata for quote-to-cash replay;
  • accounting-export, revenue-memory, connector-profile, financial-data-vault, and product-surface projection contracts when they are country-neutral;
  • agent operation catalog and safety metadata for read/draft/recommend/approval-only billing actions;
  • role-aware quote-to-cash cockpit packets, persona-to-managed-role bindings, action availability, and evidence references for downstream bundle/app seams.

Invoice-issuance contracts (additive)

The following additive operation/event contracts describe the France-ready issuance path. They sit alongside the original eight billing contract keys, which are unchanged:

  • billing.invoice.issue — issue an invoice from a quote/order, producing the canonical invoice record.
  • billing.invoice.submit — submit an issued invoice to a PDP (Plateforme de Dématérialisation Partenaire) / e-reporting target.
  • billing.invoice.submitted — event emitted once submission is accepted.
  • billing.creditNote.issue — issue a credit note (avoir) derived from a prior invoice.

These contracts stay country-neutral: France legal behavior (TVA, mandatory mentions, gapless numbering, NF203, avoir immutability) lives in @lssm-tech/lib.billing-france, and Factur-X/EN16931 generation plus PDP submission live in @lssm-tech/integration.provider-einvoicing.

Payment-provider evidence

BillingOS keeps provider-neutral payment state while retaining redacted evidence needed for reconciliation. BillingProviderReference can identify the provider object, connected merchant account, webhook event, idempotency key, and evidence references without embedding credentials or provider SDK objects. Connector profiles advertise checkout, payment-method, subscription, invoice, dispute, payout, marketplace, and webhook capabilities explicitly.

Provider network calls remain in integration packages. BillingSpec only models their normalized lifecycle and evidence.

Boundary

BillingOS core remains country-neutral. France e-invoicing/e-reporting readiness lives in @lssm-tech/lib.billing-france; deterministic helper behavior lives in @lssm-tech/lib.billing-runtime; CompanyOS/operator composition belongs in examples or an explicit module surface.

Core contracts may describe high-impact operations, but they must carry authority/autonomy and operator-approval metadata. They must not represent silent authorized execution.

Public entrypoints

  • @lssm-tech/lib.billing-spec — root barrel
  • @lssm-tech/lib.billing-spec/types — country-neutral BillingOS contract types
  • @lssm-tech/lib.billing-spec/validation — contract validation helpers
  • @lssm-tech/lib.billing-spec/fixtures — safe synthetic quote-to-cash cockpit fixtures
  • @lssm-tech/lib.billing-spec/billing-os — additive versioned catalog, exact-money, usage-truth, correction, and FinanceOS posting-handoff schemas
  • @lssm-tech/lib.billing-spec/docs — owner-module BillingOS semantic-contract DocBlock

BillingOS economic truth lifecycle

The additive billing-os surface models estimate → reservation → execution usage → provider actual → rating → invoice/import correction. Provider payloads and credentials remain outside core; only stable redacted evidence references are accepted. Unknown or stale hard-budget knowledge requires review. Reservations, invoice issuance, payment effects, collection effects, and authorized finance posting handoffs require stable ContractSpec Connect authorization references.

Billing-to-finance integration is reference-only: BillingOS emits a balanced posting handoff, while FinanceOS owns ledger acceptance and returns a receipt. Neither package imports the other.

Production-readiness safety boundaries

  • No France-specific fields, readiness schedules, PA claims, or provider routing in core.
  • No provider credentials, API keys, network calls, filesystem/database adapters, or production billing processor behavior.
  • No production PA submission, e-reporting submission, invoice send, mark-paid, refund, write-off, or VAT/tax-treatment mutation without an explicit approval packet.
  • No legal advice, tax advice, PA accreditation claim, or full accounting/general-ledger claim.

See docs/billingos-production-readiness.md and docs/billingos-v0-release-verification.md for prompt coverage, release gates, and remaining non-goals.

Canonical contract suppliers

Billing operation factories and DocBlock metadata consume the existing Core contract declarations. Complete billing spec objects, authority requirements, validation defaults and test assertions are preserved. Usage evidence types consume the complete pure Observability Spec declarations from /evidence-record and /signal-spec. Original derivation, defaults and test assertions remain unchanged. Clean declarations and affected consumers still require qualification before integration.

Service agreements (./service-agreement, additive)

Contracts for a bounded managed workflow sold as fixed setup + subscription + metered usage:

  • ServiceAgreementSchema — immutable agreement versions binding a workflow edition, installation, selected meter editions (each naming its qualifying receipt class), frozen price editions applied per whole half-open period, budget/exhaustion policy, late-arrival rule and terms. Automatic collection requires qualification evidence.
  • ServiceUsageEventSchema — strict, content-free usage facts across the estimate → reservation → usage → provider actual → invoice correction chain, with full-scope idempotency identity and reasoned exclusions.
  • OnPremUsageBatchSchema — signed, digest-only on-prem usage export.
  • ServicePriceVersionSchema, ServiceUsageRatingSchema, MeteredServiceUsageSchema and MeteredServiceUsageReceiptSchema — a versioned platform price table whose versions are explicitly unpriced or priced (ISO currency, integer micros, owner decision ref), and the strict, content-free record of one metered service call with its rating (unpriced with price_not_set or no_price_version, or priced with the exact amount). There is no default price.
  • ServicePilotAcceptanceRecordSchema and ServiceTerminationRequestSchema.
  • Operations: billing.service.usage.record|correct|summary|meter, billing.service.invoiceDraft.compute, billing.service.budget.reserve, billing.service.onprem.batch.import, billing.service.agreement.terminate, and approval-gated billing.service.invoice.submit|issue (execution.approval.required) (serviceAgreementContracts).

The subpath is not re-exported from the root barrel.

Declared capabilities.

Lib Billing Spec

Country-neutral BillingOS quote-to-cash contracts, invariants, and agent action governance types.

Use it to

  • Adopt country-neutral billingos quote-to-cash contracts, invariants, and agent action governance types

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/lib.billing-spec package constraints do not match the target runtime or platform.

@lssm-tech/lib.billing-spec

@lssm-tech/lib.billing-spec/billing-os

@lssm-tech/lib.billing-spec/billing-os/canonical

@lssm-tech/lib.billing-spec/billing-os/catalog

@lssm-tech/lib.billing-spec/billing-os/commerce

@lssm-tech/lib.billing-spec/billing-os/docs

@lssm-tech/lib.billing-spec/billing-os/fixtures

@lssm-tech/lib.billing-spec/billing-os/governance

@lssm-tech/lib.billing-spec/billing-os/packet

@lssm-tech/lib.billing-spec/billing-os/primitives

@lssm-tech/lib.billing-spec/billing-os/usage-truth

@lssm-tech/lib.billing-spec/billing-os/validation

Imports and export paths.

33 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

33 imports

Dependencies and related packages.

Runtime dependencies 3
zod
catalog:
Development dependencies 3
typescript
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
devcontractspec-bun-build dev
cleanrimraf dist .turbo
lintbun lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
testbun test
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit
Your view

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Your context

The different parts of you

Choose a starting point

A useful mix of context, visuals and gentle guidance.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Reading comfort

Choose your language

Interface language changes text only. Markets, prices and workflows keep their own settings.

Translation coverage

Original source

Navigation151
Graph616
Categories378
Portfolio833
Examples2,035
Source preview1,542

More translations will be added as content is reviewed.

This preference is saved on this browser.

Search the website

Useful starting points

No results. Try a shorter phrase, an operation name or another search area.

A LITTLE ROOM TO EXPLORE

Find something to explore.

Open a closer look on this page, try a different perspective, or follow the detail into its own page.

How previews and controls work
01

Look before you leave

Hover a link or focus it with Tab to see a preview. Clicking the original link or pressing Enter always opens its destination.

02

Stay with the context

Move into the preview to explore its sections. Use Alt + ↓ from a focused link to enter it with the keyboard. Escape closes it.

03

Open the possibilities

Disclosure rows, perspective choices and highlighted controls reveal more. Your view changes reading comfort and the context you explore.

A separate button for a closer look

Show small preview buttons beside links where there is room. Tap the eye to inspect, or tap the link to go straight there. This choice stays in this tab.

No browsing history is collected. Reduced motion follows your device and Your view.