import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "./models/index.js"; export declare class Subscriptions extends ClientSDK { /** * Create subscription * * @remarks * Use when onboarding a customer to a plan or starting a new subscription. Ideal for draft subscriptions (activate later) or active from start. */ createSubscription(request: models.CreateSubscriptionRequest, options?: RequestOptions): Promise; /** * Add addon to subscription * * @remarks * Deprecated: use POST /subscriptions/{id}/modify/execute with type "addon" and action "add", which also supports previewing the proration charge first. * Use when adding an optional product or add-on to an existing subscription (e.g. extra storage or support tier). * * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. */ addSubscriptionAddon(request: models.AddAddonRequest, options?: RequestOptions): Promise; /** * Remove addon from subscription * * @remarks * Deprecated: use POST /subscriptions/{id}/modify/execute with type "addon" and action "remove", which also supports previewing the proration credit first. * Use when removing an add-on from a subscription (e.g. downgrade or opt-out). * * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. */ removeSubscriptionAddon(request: models.RemoveAddonRequest, options?: RequestOptions): Promise; /** * Search subscription line items * * @remarks * List subscription line items with a JSON filter (subscription, customer, price, pagination, expand=prices, etc.). */ querySubscriptionLineItems(request: models.SubscriptionLineItemFilter, options?: RequestOptions): Promise; /** * Update subscription line item * * @remarks * Use when changing a subscription line item (e.g. quantity or price). Implemented by ending the current line and creating a new one for clean billing. */ updateSubscriptionLineItem(id: string, body: models.UpdateSubscriptionLineItemRequest, options?: RequestOptions): Promise; /** * Delete subscription line item * * @remarks * Use when removing a charge or seat from a subscription (e.g. downgrade). Line item ends; retained for history but no longer billed. */ deleteSubscriptionLineItem(id: string, body: models.DeleteSubscriptionLineItemRequest, options?: RequestOptions): Promise; /** * Query subscriptions * * @remarks * Use when listing or searching subscriptions (e.g. admin view or customer subscription list). Returns a paginated list; supports filtering by customer, plan, status. */ querySubscription(request: models.SubscriptionFilter, options?: RequestOptions): Promise; /** * Get usage by subscription * * @remarks * Use when showing usage for a subscription (e.g. in a portal or for overage checks). Supports time range and filters. */ getSubscriptionUsage(request: models.GetUsageBySubscriptionRequest, options?: RequestOptions): Promise; /** * Get subscription * * @remarks * Use when you need to load a single subscription (e.g. for a billing portal or to check status). */ getSubscription(id: string, options?: RequestOptions): Promise; /** * Update subscription * * @remarks * Use when changing subscription details (e.g. quantity, billing anchor, or parent). Supports partial update; send "" to clear parent_subscription_id. */ updateSubscription(id: string, body: models.UpdateSubscriptionRequest, options?: RequestOptions): Promise; /** * Activate draft subscription * * @remarks * Use when turning a draft subscription live (e.g. after collecting payment or completing setup). Once activated, billing and entitlements apply. */ activateSubscription(id: string, body: models.ActivateDraftSubscriptionRequest, options?: RequestOptions): Promise; /** * Get active addon associations * * @remarks * Use when listing which add-ons are currently attached to a subscription (e.g. for display or editing). */ getSubscriptionAddonAssociations(id: string, options?: RequestOptions): Promise>; /** * Cancel subscription * * @remarks * Use when a customer churns or downgrades. Supports immediate or end-of-period cancellation and proration. Ideal for self-serve or support-driven cancellations. */ cancelSubscription(id: string, body: models.CancelSubscriptionRequest, options?: RequestOptions): Promise; /** * Execute subscription plan change * * @remarks * Use when applying a plan change (e.g. upgrade or downgrade). Executes proration and generates invoice or credit as needed. */ executeSubscriptionChange(id: string, body: models.SubscriptionChangeRequest, options?: RequestOptions): Promise; /** * Preview subscription plan change * * @remarks * Use when showing a customer the cost of a plan change before they confirm (e.g. upgrade/downgrade preview with proration). */ previewSubscriptionChange(id: string, body: models.SubscriptionChangeRequest, options?: RequestOptions): Promise; /** * Execute a plan change (v2, swap in place) * * @remarks * Change a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction. * * change_at controls timing. Omitted or 'immediate' applies the change now. 'end_of_period' records a pending schedule that executes at the subscription's current period end: the response returns is_scheduled, schedule_id and scheduled_at instead of a completed change, and nothing is swapped or billed until the boundary. * * scheduled_at is resolved from the subscription's current period end at request time. If that period end is already in the past (a backdated start date, a resumed pause, or worker downtime can all leave a subscription behind), the change is due immediately and fires on the next billing scan rather than a period away — inspect scheduled_at to see this. * * Only one plan change may be pending per subscription. By default (on_conflict_policies.on_pending_schedule = 'reject') a second request returns 400; cancel the existing schedule via POST /subscriptions/schedules/{schedule_id}/cancel first. Pending schedules are listable via GET /subscriptions/{id}/schedules. * * Set on_conflict_policies.on_pending_schedule to 'supersede' to replace the queued change instead: the pending schedule is cancelled and this request applied in the same transaction, so both land or neither does. The cancelled schedule ids are returned in superseded_schedules, and preview reports the same list without writing. */ executeSubscriptionPlanChangeV2(id: string, body: models.SubscriptionChangeV2Request, options?: RequestOptions): Promise; /** * Preview a plan change (v2, swap in place) * * @remarks * Preview a subscription plan change without writing. Swap-in-place: subscription id, billing anchor and period bounds are preserved. */ previewSubscriptionPlanChangeV2(id: string, body: models.SubscriptionChangeV2Request, options?: RequestOptions): Promise; /** * Get subscription entitlements * * @remarks * Use when checking what features or limits a subscription has (e.g. entitlement checks or feature gating). Optional feature_ids to filter. */ getSubscriptionEntitlements(id: string, featureIds?: Array | undefined, options?: RequestOptions): Promise; /** * Get upcoming credit grant applications * * @remarks * Use when showing upcoming or pending credits for a subscription (e.g. in a portal or for forecasting). */ getSubscriptionUpcomingGrants(id: string, options?: RequestOptions): Promise; /** * Create subscription line item * * @remarks * Use when adding a new charge or seat to a subscription (e.g. extra seat or one-time add). Supports price_id or inline price. */ createSubscriptionLineItem(id: string, body: models.CreateSubscriptionLineItemRequest, options?: RequestOptions): Promise; /** * Execute subscription modification * * @remarks * Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax, or addon add/remove). */ executeSubscriptionModify(id: string, body: models.ExecuteSubscriptionModifyRequest, options?: RequestOptions): Promise; /** * Preview subscription modification * * @remarks * Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax, or addon add/remove) without committing changes. */ previewSubscriptionModify(id: string, body: models.ExecuteSubscriptionModifyRequest, options?: RequestOptions): Promise; /** * Get subscription (V2) * * @remarks * Use when you need a subscription with related data (line items, prices, plan). Supports expand for detailed payloads without extra round-trips. */ getSubscriptionV2(id: string, expand?: string | undefined, options?: RequestOptions): Promise; /** * List all subscription schedules * * @remarks * Use when listing or searching scheduled changes across subscriptions (e.g. admin view). Returns schedules with optional filtering. */ listAllSubscriptionSchedules(pendingOnly?: boolean | undefined, subscriptionId?: string | undefined, limit?: number | undefined, offset?: number | undefined, options?: RequestOptions): Promise; /** * Get subscription schedule * * @remarks * Use when you need to load a single scheduled change (e.g. to show when a plan change or renewal takes effect). */ getSubscriptionSchedule(id: string, options?: RequestOptions): Promise; /** * Cancel subscription schedule * * @remarks * Use when cancelling a scheduled change (e.g. customer changed mind). Identify by schedule ID in path or by subscription ID + schedule type in body. */ cancelSubscriptionSchedule(scheduleId: string, body?: models.CancelScheduleRequest | undefined, options?: RequestOptions): Promise; /** * List subscription schedules * * @remarks * Use when listing scheduled changes for a subscription (e.g. upcoming plan change or renewal). Returns all schedules for that subscription. */ listSubscriptionSchedules(subscriptionId: string, options?: RequestOptions): Promise; } //# sourceMappingURL=subscriptions.d.ts.map