Subscription Purchases

Table name: subscription_purchases

Contains subscription purchase records with financial details and operator-based filtering logic. Tracks purchase transactions including discounts, amounts, and unit quantities for subscriptions. Includes operator matching flags to support different filtering criteria based on subscription and customer operator relationships.

SQL: subscription_purchases

Schema

Column NameData TypeDescription
Primary ID
idINTEGERPrimary key
Other IDs
subscription_idINTEGERReferences the subscription associated with this purchase
currency_idINTEGERReferences the currency used for this purchase transaction
Timestamps
created_atTIMESTAMP_NTZTimestamp when the purchase record was created
updated_atTIMESTAMP_NTZTimestamp when the purchase record was last modified
deleted_atTIMESTAMP_NTZTimestamp when the purchase record was soft deleted
subscription_deleted_atTIMESTAMP_NTZTimestamp when the associated subscription was soft deleted
subscription_operator_deleted_atTIMESTAMP_NTZTimestamp when the subscription's operator was soft deleted
Filters
is_direct_operator_matchBOOLEANTrue when the subscription's operator_id directly matches the filtered operator
is_customer_operator_matchBOOLEANTrue when the subscription's customer_operator_id matches the filtered operator
Attributes
typeVARCHARClassification or category of the subscription purchase
discount_percentageNUMBERPercentage-based discount applied to the purchase
discount_absoluteNUMBERFixed amount discount applied to the purchase
original_amountNUMBERBase purchase amount before any discounts are applied
discount_amountNUMBERTotal monetary value of discounts applied to the purchase
total_amountNUMBERFinal purchase amount after all discounts have been applied
min_unitsNUMBERMinimum number of units required for this purchase
total_unitsNUMBERTotal number of units included in the purchase
actual_unitsNUMBERActual number of units delivered or consumed
noteVARCHARAdditional comments or details about the purchase
operator_is_main_operator_matchBOOLEANIndicates whether the operator matches the main operator criteria
operator_is_parent_operator_matchBOOLEANIndicates whether the operator matches the parent operator criteria

Data inclusion criteria

This table uses the includes rows where the operator ID matches either the subscription's operator or subscription customer's operator
This means this table may include purchases on subscriptions not included in the subscriptions table because they are not the operator's subscriptions.

Data flow

Upstream tablesDownstream tables
operators---

Alignment

Partner API


Did this page help you?