Available data types
The following diagram describes the relations between the available data types:Notes
- Mandatory fields are represented using a NOT NULL column constraint.
- TIMESTAMP_TZ field type represents a date and time with a time-zone offset.
- JSON field type represents JSON object literals containing key/value pairs.
Customer
Represents a customer of your application, which can be either an individual or an organization. Each customer can have a subscription to a product, a set of entitlements, and usage records. Table: CUSTOMERSCustomer Resource
Represents a resource associated with a customer, such as a site or an app. Each resource can have its own subscription to a product, as well as a distinct set of entitlements and usage records. Table: CUSTOMER_RESOURCESSubscription
Represents the combination of functionalities to which a specific customer has access, including their limitations, the duration of access, and the associated cost. Subscriptions encompass both plans and add-ons. Table: SUBSCRIPTIONSSubscription Price
Represents the price of the subscription. Multiple prices can be associated with a single subscription to support a pricing model based on multiple billable metrics Table: SUBSCRIPTION_PRICESSubscription Add-on
Represents the quantity of an add-on that is included in the subscription. Table: SUBSCRIPTION_ADDONSSubscription Applied Coupons
Represents a coupon entity attached to a subscription. Table: SUBSCRIPTION_APPLIED_COUPONSProduct
Represents a product or product line. Typically, products group together plans and add-ons. Table: PRODUCTSPlan
Represents a package of a product for which customers are charged during a subscription period. The features included in each plan are defined by entitlements associated with the plan. Plans can inherit features from one another. Table: PLANSAdd-on
Represents a package that extends specific plans. Add-ons are dependent on the lifecycle of the plan they extend; meaning, when a subscription expires, customers also lose access to the plan’s add-ons. The features included in each add-on are defined by entitlements associated with the add-on. Table: ADDONSPrice
Represents the price of a package and its settings. Table: PRICESPackage Entitlement
Represents a feature entitlement associated with a plan or add-on. Table: PACKAGE_ENTITLEMENTSPromotional Entitlement
Represents ad-hoc entitlements that are given to a specific customer. Promotional entitlements can be granted to customers for a limited time period or throughout their entire lifetime. Table: PROMOTIONAL_ENTITLEMENTSFeature
Represents a configurable functionality in the product that can be monetized. Table: FEATURESEntitlement
Represents the right to use an application feature, and to what extent. In Stigg, customer entitlements can be granted from multiple sources: plans, add-ons, overlapping trial subscriptions, promotional entitlements, and additional products. Entitlements are typically computed and cached. If one of the entitlement sources changes, the entitlements need to be refreshed. You can read about how entitlements are calculated here. Table: ENTITLEMENTSUsage Measurement
Represents calculated usage reports associated with a customer for a metered feature. Table: USAGE_MEASUREMENTSUsage Events
Represents the raw usage events associated with a customer.To enable reporting of raw usage events, please contact Stigg support.
When enabled, the usage_events table will also include events of calculated usage reports that were made to Stigg. Such reports will appear as $usage.reported events.
Coupon
Represents a discount coupon that can be applied to a customer. Table: COUPONSCredits
Credit Usage
Represents raw credit usage activity for a customer/resource. Table: CREDITS_USAGE_<ENVIRONMENT_ID>The
CREDITS_USAGE table does not include event dimensions. To enrich credit usage records with dimensions, join with the USAGE_EVENT table:Custom Currency
Represents a custom credit currency configured for an account (e.g., “Build Credits”, “AI Tokens”). Table: CUSTOM_CURRENCIESCredit Grant
Represents a grant (allocation) of credits to a customer and/or resource, including lifecycle, amount, and consumption. Table: CREDIT_GRANTSIntegrations
Integration
Represents a native integration of a third-party application (i.e. Stripe, Salesforce, etc.) with Stigg. Table: INTEGRATIONCustomer Integration
A linking table between the Customer table and the Integration table. Table: CUSTOMER_INTEGRATIONSubscription Integration
A linking table between the Subscription table and the Integration table. Table: SUBSCRIPTION_INTEGRATIONPlan Integration
A linking table between the Plan table and the Integration table. Table: PLAN_INTEGRATIONAdd-on Integration
A linking table between the Add-on table and the Integration table. Table: ADDON_INTEGRATIONCoupon Integration
A linking table between the Coupon table and the Integration table. Table: COUPON_INTEGRATIONExport metadata
Every table except
USAGE_EVENT_<ENVIRONMENT_ID> and CREDITS_USAGE_<ENVIRONMENT_ID> also carries an EXPORTED_AT column. The two usage tables carry their own event timestamps instead.EXPORTED_AT reflects when the export ran, not when the row was created or last changed in Stigg — use CREATED_AT and UPDATED_AT for that.