Application Load

ICustomerSubscription

The physical TypeScript declaration from the Nuxt starter, with linked types and field comments.

ICustomerSubscription

Owned customer subscription.

src/lib/interfaces/orionplace/subscribes/ISubscriptionApi.ts
TypeScript
export interface ICustomerSubscription {
  // Customer subscription ID. Use this for renewal and subscription-support
  // tickets.
  id: number;
  // Subscription-definition ID of the current period, or null without one.
  subscription: number | null;
  // Current-period plan ID, or null without a current period. Match it to
  // page_data.tariffs[].id; this list also includes the plans of expired
  // subscriptions and plans closed to new purchases.
  tariff: number | null;
  // ID of the service option the subscription was bought with, or null when it
  // has none.
  option: number | null;
  // Subscription creation time.
  creation_date: IApiDateTime;
  // End of paid access, or null. Negative days_ago means the date is still
  // ahead. Check remote_subscription_sync_pending first when displaying
  // Pending/Active/Ended.
  active_until: IApiDateTime | null;
  // Time renewal was stopped with subscriptions_cancel or the subscription was
  // fully refunded, or null while neither state remains. Enabling renewal or
  // buying a newer paid period clears it. Customer cancellation keeps access
  // through active_until and refunds nothing.
  cancelled_date: IApiDateTime | null;
  // Amount refunded to the account balance when this subscription is moved to
  // another plan or service option, by currency ID: the unused days of every
  // paid period that has not ended yet. `subscriptions_change_tariff` and
  // `subscriptions_change_option` credit it before they charge the new period,
  // so it counts towards what the change can cost.
  returned_amount: ICurrencyAmounts;
  // Number of support tickets for the subscription.
  c_tickets: number;
  /** Partner code a trial remembered, while it waits for the first payment; fill the promo field with it on upgrade. */
  referral_code: string | null;
  // Configured renewal duration and currency amounts, or null when disabled.
  // With a current period, tariff and option costs are separate; the fallback
  // shape contains `cost`. This field does not include the tariff-cost ID.
  renew_period: ICustomerSubscriptionRenewal | null;
  // Service identity, last confirmation, pending flag and customer data/usage
  // packages. The object is returned even without a connected service; package
  // values and the remote ID can be null.
  plugin: {
    // Value of remote_subscription_last_sync.
    remote_subscription_last_sync: IApiDateTime | null;
    // Value of remote_subscription_sync_pending.
    remote_subscription_sync_pending: boolean;
    // Value of remote_subscription_data_user.
    remote_subscription_data_user: JsonValue;
    // Value of remote_subscription_tariff_usages.
    remote_subscription_tariff_usages: JsonValue;
    // Value of remote_subscription_id.
    remote_subscription_id: number | null;
  };
}