Skip to main content

Data Model

In a nutshell

This page documents the internal tables and model relationships used by the billing engine. Use this section for implementation, demo, and handoff context.

Tables

TableModelPurpose
tenantsTenantBusiness account, API key, webhook URL, Nomba account mapping.
plansPlanCurrent plan definition used for new subscriptions.
plan_versionsPlanVersionVersioned plan snapshots used by subscriptions.
customersCustomerMerchant end customer.
subscriptionsSubscriptionRecurring billing relationship between customer and plan.
payment_sourcesPaymentSourceSaved card token or bank mandate reference.
invoicesInvoiceAmount due for a billing cycle.
payment_intentsPaymentIntentAttempt to collect payment for a subscription/invoice.
webhook_deliveriesWebhookDeliveryOutgoing merchant webhook delivery record.
webhook_delivery_attemptsWebhookDeliveryAttemptIndividual webhook delivery attempt result.
nomba_webhook_eventsNombaWebhookEventIncoming provider webhook event log model.
nomba_initiationsNombaInitiationNomba checkout/charge initiation and metadata mapping.
settlementsSettlementPending/completed/failed settlement record.
email_deliveriesEmailDeliveryQueued customer lifecycle emails.

Code prefixes

ObjectGenerated code prefix
PlanPLN_
CustomerCUST_
SubscriptionSUB_
InvoiceINV_
Payment intentPAY_

Core relationships

Tenant
  -> Plans
  -> Customers
       -> PaymentSources
       -> Subscriptions
            -> Invoices
            -> PaymentIntents
  -> WebhookDeliveries
  -> EmailDeliveries

Hidden tenant fields

Most resource JSON responses omit tenantId because the API resolves tenant ownership from the API key. Internal records still store tenant IDs for isolation.