SaaS Platforms
White-label invoicing for your SaaS customers. Each customer gets isolated data with their own branding.
How It Works
SaaS multi-tenant structure
┌───────────────────────────────────────────────┐
│ Your SaaS Platform │
├───────────────┬───────────────┬───────────────┤
│ Customer A │ Customer B │ Customer C │
│ entity_123 │ entity_456 │ entity_789 │
├───────────────┼───────────────┼───────────────┤
│ Invoices │ Invoices │ Invoices │
│ Customers │ Customers │ Customers │
│ Items │ Items │ Items │
│ Settings │ Settings │ Settings │
└───────────────┴───────────────┴───────────────┘1. Onboard a Customer
When a customer signs up on your platform, create an entity for them:
// title: Onboard customer
const entity = await sdk.entities.create({
name: customer.companyName,
address: customer.address,
city: customer.city,
country: customer.country,
currency_code: customer.currency,
});
// Store entity.id with your customer record
await db.customers.update(customer.id, { entityId: entity.id });2. Set Up Their Branding
// title: Custom branding
await sdk.entities.update(entity.id, {
settings: {
pdf_template: {
logo_url: "https://example.com/logo.png",
primary_color: "#3B82F6",
},
email_defaults: {
sender_name: customer.companyName,
},
},
});3. Create Invoices
All operations are scoped to the customer’s entity:
// title: Create invoice for customer
const invoice = await sdk.invoices.create(
{
customer: { name: "End Client", email: "client@example.com" },
items: [{ name: "Monthly subscription", quantity: 1, price: 99 }],
},
{ entity_id: customer.entityId }
);4. Give Customers Dashboard Access (Optional)
Simple approach — Use entity API keys (no user management):
// title: Embedded dashboard (simple)
const token = await sdk.entityUsers.generateToken(entity.id, user.id);
// Redirect to embedded dashboard
window.location.href = `https://app.spaceinvoices.com/embed?token=${token}`;With roles — Use user-based access for team collaboration:
// title: Embedded dashboard (with users)
// Add user to entity
await sdk.entityUsers.add(entity.id, {
email: user.email,
role: "admin",
});
// Generate magic link
const token = await sdk.entityUsers.generateToken(entity.id, user.id);
const dashboardUrl = `https://app.spaceinvoices.com/embed?token=${token}`;See User Access Guide for detailed comparison.
Key Benefits
- Full isolation — Data never mixes between customers
- Custom branding — Each customer sees their logo and settings
- Compliance handled — We manage tax rules per customer’s country
- Usage-based pricing — Bill based on invoices created per entity
- Optional self-service — Customers can manage their own invoices
Integration Flow
SaaS integration flow
┌──────────────┐ ┌─────────────────┐ ┌──────────────┐
│ Customer │ │ Your SaaS │ │ Space │
│ Signs Up │────▶│ Platform │────▶│ Invoices │
└──────────────┘ └─────────────────┘ └──────────────┘
│ │
│ 1. Create Entity │
│─────────────────────▶│
│ │
│ 2. Store entity_id │
│◀─────────────────────│
│ │
│ 3. Create invoices │
│─────────────────────▶│
│ │Next Steps
- User Access Guide — Give customers direct dashboard access
- Multi-Tenancy Guide — Deep dive into entity management
- Compliance — Country-specific requirements