lomi.
Platform

Organizations

Retrieve organization details and metrics.

The Organizations API provides access to your organization's details and business metrics.

Get organization details

Retrieve details of your authenticated organization.

import { LomiSDK } from '@lomi./sdk';

const lomi = new LomiSDK({
  apiKey: process.env.LOMI_API_KEY!,
  environment: 'live',
});

const org = await lomi.organizations.list();
console.log(`Organization: ${org[0].name}`);
from lomi import LomiClient
import os

client = LomiClient(
    api_key=os.environ["LOMI_API_KEY"],
    environment="test"
)

orgs = client.organizations.list()
print(f"Organization: {orgs[0]['name']}")
curl -X GET "https://api.lomi.africa/organizations" \
  -H "X-API-KEY: $LOMI_API_KEY"

Get organization by ID

Retrieve a specific organization (must match your authenticated organization).

const org = await lomi.organizations.get('org_abc123...');
org = client.organizations.get('org_abc123...')
curl -X GET "https://api.lomi.africa/organizations/org_abc123..." \
  -H "X-API-KEY: $LOMI_API_KEY"

Get organization metrics

Retrieve pre-calculated business metrics including MRR, ARR, revenue, and customer counts.

const metrics = await lomi.organizations.getMetrics();

console.log(`MRR: ${metrics.mrr} ${metrics.currency_code}`);
console.log(`ARR: ${metrics.arr} ${metrics.currency_code}`);
console.log(`Total Revenue: ${metrics.total_revenue}`);
console.log(`Total Customers: ${metrics.total_customers}`);
console.log(`Total Transactions: ${metrics.total_transactions}`);
metrics = client.organizations.get_metrics()

print(f"MRR: {metrics['mrr']} {metrics['currency_code']}")
print(f"ARR: {metrics['arr']} {metrics['currency_code']}")
print(f"Total Revenue: {metrics['total_revenue']}")
print(f"Total Customers: {metrics['total_customers']}")
curl -X GET "https://api.lomi.africa/organizations/metrics" \
  -H "X-API-KEY: $LOMI_API_KEY"

Response

{
  "mrr": 50000,
  "arr": 600000,
  "total_revenue": 250000,
  "total_transactions": 1234,
  "total_customers": 567,
  "currency_code": "XOF",
  "calculated_at": "2024-01-15T00:00:00Z"
}

Metrics Object

FieldTypeDescription
mrrnumberMonthly Recurring Revenue
arrnumberAnnual Recurring Revenue
total_revenuenumberTotal revenue generated
total_transactionsnumberTotal transaction count
total_customersnumberTotal customer count
currency_codestringCurrency for monetary values
calculated_atstringCalculation timestamp

Organization Object

FieldTypeDescription
idstringUnique organization identifier
namestringOrganization name
emailstringContact email
countrystringCountry
currency_codestringDefault currency
created_atstringCreation timestamp

Error Responses

StatusDescription
401Invalid or missing API key
404Organization not found or access denied

On this page