🧭✨ Future Subscription Purchases (NEW)

✨ NEW TABLE - December 2025

🛠️ Partner API Alignment Migration

🧭 This table represents the post-migration state for subscription_purchases.

1️⃣ Migrate to this table by April 2026

2️⃣ Between April 2026 and July 2026, remove FUTURE__ prefix

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: FUTURE__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

Changes from Last Version

This table was entirely rearchitected to match the Partner API. We now include not only purchases on the operator's subscriptions but also by the operator's customers. Multiple columns were added.

Added columns (7)

Timestamps:

  • deleted_at (purchase deletion status)
  • subscription_deleted_at (subscription deletion status)
  • subscription_operator_deleted_at (operator deletion status)

Attributes:

  • min_units
  • note

Filter Flags (Computed):

  • operator_is_main_operator_match (boolean)
  • operator_is_parent_operator_match (boolean)
  • is_direct_operator_match (boolean - subscription's operator_id matches)
  • is_customer_operator_match (boolean - subscription's customer operator matches)

Removed columns (0)

Renamed Columns (1)

  • purchase_id → id

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 FUTURE__subscriptions table because they are not the operator's subscriptions.

Data flow

Upstream tablesDownstream tables
FUTURE_operators---

Alignment

Partner API

subscription_purchases table

Because the scope of the table has expanded, one must exclude rows previously not included via a complex where clause:

where deleted_at is null 
and subscription_deleted_at is null 
and subscription_operator_deleted_at is null
and is_direct_operator_match