Introduction
REST API for compliant invoicing. Multi-tenant by design.
Every endpoint in the API Reference includes examples showing different usage patterns.
API Structure
Resource-based REST. All resources scoped to an entity: GET /v1/entities/:id/invoices
Multi-Tenancy
Multi-tenancy structure
┌───────────────────────────────────────────┐
│ Your Platform │
│ (Account-level API key) │
└───────────────────┬───────────────────────┘
│
┌─────────────┼─────────────┐
│ │ │
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ Entity A │ │ Entity B │ │ Entity C │
├───────────┤ ├───────────┤ ├───────────┤
│ • Data │ │ • Data │ │ • Data │
│ • Config │ │ • Config │ │ • Config │
│ • Users │ │ • Users │ │ • Users │
└───────────┘ └───────────┘ └───────────┘Each entity is isolated with its own data and settings.
Sandbox
Test with sandbox API keys. Same API, isolated test data.
Quick Example
import SpaceInvoices from "@spaceinvoices/js-sdk";
const sdk = new SpaceInvoices("YOUR_API_KEY");
const invoice = await sdk.invoices.create({
customer: { name: "Acme Corp", email: "billing@acme.com" },
items: [{ name: "Web Development", quantity: 1, price: 2500 }],
});
console.log(invoice.number); // INV-2024-0001Next Steps
- Core Concepts — How the pieces fit together
- Quickstart — First invoice in 5 minutes
- Multi-Tenancy — For platforms with multiple customers