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 Name | Data Type | Description |
|---|---|---|
| Primary ID | ||
| id | INTEGER | Primary key |
| Other IDs | ||
| subscription_id | INTEGER | References the subscription associated with this purchase |
| currency_id | INTEGER | References the currency used for this purchase transaction |
| Timestamps | ||
| created_at | TIMESTAMP_NTZ | Timestamp when the purchase record was created |
| updated_at | TIMESTAMP_NTZ | Timestamp when the purchase record was last modified |
| deleted_at | TIMESTAMP_NTZ | Timestamp when the purchase record was soft deleted |
| subscription_deleted_at | TIMESTAMP_NTZ | Timestamp when the associated subscription was soft deleted |
| subscription_operator_deleted_at | TIMESTAMP_NTZ | Timestamp when the subscription's operator was soft deleted |
| Filters | ||
| is_direct_operator_match | BOOLEAN | True when the subscription's operator_id directly matches the filtered operator |
| is_customer_operator_match | BOOLEAN | True when the subscription's customer_operator_id matches the filtered operator |
| Attributes | ||
| type | VARCHAR | Classification or category of the subscription purchase |
| discount_percentage | NUMBER | Percentage-based discount applied to the purchase |
| discount_absolute | NUMBER | Fixed amount discount applied to the purchase |
| original_amount | NUMBER | Base purchase amount before any discounts are applied |
| discount_amount | NUMBER | Total monetary value of discounts applied to the purchase |
| total_amount | NUMBER | Final purchase amount after all discounts have been applied |
| min_units | NUMBER | Minimum number of units required for this purchase |
| total_units | NUMBER | Total number of units included in the purchase |
| actual_units | NUMBER | Actual number of units delivered or consumed |
| note | VARCHAR | Additional comments or details about the purchase |
| operator_is_main_operator_match | BOOLEAN | Indicates whether the operator matches the main operator criteria |
| operator_is_parent_operator_match | BOOLEAN | Indicates 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 tables | Downstream tables |
|---|---|
operators | --- |
Alignment
Partner API
- Aligns with Partner API get/subscription-purchases endpoint
Updated 20 days ago
Did this page help you?
