Query subscriptions
Use when listing or searching subscriptions (e.g. admin view or customer subscription list). Returns a paginated list; supports filtering by customer, plan, status.
Request body
ActiveAt filters subscriptions that are active at the given time
BillingCadence filters by billing cadence
BillingPeriod filters by billing period
CustomerID filters by customer ID
CustomerIDs filters by customer IDs
EffectiveDateForUpdate selects subscriptions that need a billing-period pass on or before this time: current_period_end <= date OR (cancel_at IS NOT NULL AND cancel_at <= date). When nil, period/cancel cutoff logic is not applied by this field (see TimeRangeFilter for legacy period-end filtering).
ExternalCustomerID filters by external customer ID
InvoicingCustomerIDs filters by invoicing customer ID
ParentSubscriptionIDs filters by parent subscription IDs
PlanID filters by plan ID
SubscriptionStatus filters by subscription status
SubscriptionType filters by subscription type
TrialEndDueLTE, when set, restricts to subscriptions with trial_end not nil and trial_end <= trial_end_due_lte. Use with subscription_status trialing for trial-end cron processing.
WithCouponAssociations eager-loads coupon associations and their coupons.
Kept separate from WithLineItems because the coupon_associations table has no index leading with subscription_id, so Ent's edge load degrades to a full table scan. Only set it when the response actually surfaces the associations; the service layer back-fills it from expand="coupon_associations".
WithLineItems includes line items in the response.
Deprecated: use expand="subscription_line_items" instead. Retained for backwards compatibility and for internal callers that need to force-disable line item loading (set to false). The service layer ORs this with the expand check before invoking the repository.
Response
OK