# SubscriptionResponseV2

## Example Usage

```typescript
import { SubscriptionResponseV2 } from "@flexprice/sdk/sdk/models";

let value: SubscriptionResponseV2 = {
  couponAssociations: [
    {
      subscriptionLineItem: {
        price: {
          addon: {
            prices: [
              {
                addon: {},
                meter: {
                  createdAt: new Date("2024-03-20T15:04:05Z"),
                  eventName: "api_request",
                  id: "550e8400-e29b-41d4-a716-446655440000",
                  name: "API Usage Meter",
                  status: "published",
                  tenantId: "tenant123",
                  updatedAt: new Date("2024-03-20T15:04:05Z"),
                },
                plan: {},
              },
            ],
          },
          meter: {
            createdAt: new Date("2024-03-20T15:04:05Z"),
            eventName: "api_request",
            id: "550e8400-e29b-41d4-a716-446655440000",
            name: "API Usage Meter",
            status: "published",
            tenantId: "tenant123",
            updatedAt: new Date("2024-03-20T15:04:05Z"),
          },
          plan: {},
        },
      },
    },
  ],
  lineItems: [
    {
      price: {
        addon: {
          prices: [
            {
              addon: {},
              meter: {
                createdAt: new Date("2024-03-20T15:04:05Z"),
                eventName: "api_request",
                id: "550e8400-e29b-41d4-a716-446655440000",
                name: "API Usage Meter",
                status: "published",
                tenantId: "tenant123",
                updatedAt: new Date("2024-03-20T15:04:05Z"),
              },
              plan: {},
            },
          ],
        },
        meter: {
          createdAt: new Date("2024-03-20T15:04:05Z"),
          eventName: "api_request",
          id: "550e8400-e29b-41d4-a716-446655440000",
          name: "API Usage Meter",
          status: "published",
          tenantId: "tenant123",
          updatedAt: new Date("2024-03-20T15:04:05Z"),
        },
        plan: {},
      },
    },
  ],
  plan: {},
};
```

## Fields

| Field                                                                                                                                                                                                                                             | Type                                                                                                                                                                                                                                              | Required                                                                                                                                                                                                                                          | Description                                                                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `activePauseId`                                                                                                                                                                                                                                   | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | ActivePauseID references the current active pause configuration<br/>This will be null if no pause is active or scheduled                                                                                                                          |
| `autoInvoiceThreshold`                                                                                                                                                                                                                            | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers<br/>an intermediate invoice. Overrides the plan-level threshold when set.<br/>Nil means: inherit from the plan's threshold (which may also be nil = disabled).  |
| `billingAnchor`                                                                                                                                                                                                                                   | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | BillingAnchor is the reference point that aligns future billing cycle dates.<br/>It sets the day of week for week intervals, the day of month for month and year intervals,<br/>and the month of year for year intervals. The timestamp is in UTC format. |
| `billingCadence`                                                                                                                                                                                                                                  | [models.BillingCadence](../../sdk/models/billing-cadence.md)                                                                                                                                                                                      | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `billingCycle`                                                                                                                                                                                                                                    | [models.BillingCycle](../../sdk/models/billing-cycle.md)                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `billingPeriod`                                                                                                                                                                                                                                   | [models.BillingPeriod](../../sdk/models/billing-period.md)                                                                                                                                                                                        | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `billingPeriodCount`                                                                                                                                                                                                                              | *number*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | BillingPeriodCount is the total number units of the billing period.                                                                                                                                                                               |
| `cancelAt`                                                                                                                                                                                                                                        | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | CancelAt is the date the subscription will be canceled                                                                                                                                                                                            |
| `cancelAtPeriodEnd`                                                                                                                                                                                                                               | *boolean*                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                | CancelAtPeriodEnd is whether the subscription was canceled at the end of the current period                                                                                                                                                       |
| `cancelledAt`                                                                                                                                                                                                                                     | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | CanceledAt is the date the subscription was canceled                                                                                                                                                                                              |
| `collectionMethod`                                                                                                                                                                                                                                | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | CollectionMethod determines how invoices are collected                                                                                                                                                                                            |
| `commitmentAmount`                                                                                                                                                                                                                                | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | CommitmentAmount is the minimum amount a customer commits to paying for a billing period                                                                                                                                                          |
| `commitmentDuration`                                                                                                                                                                                                                              | [models.BillingPeriod](../../sdk/models/billing-period.md)                                                                                                                                                                                        | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `couponAssociations`                                                                                                                                                                                                                              | [models.CouponAssociationResponse](../../sdk/models/coupon-association-response.md)[]                                                                                                                                                             | :heavy_minus_sign:                                                                                                                                                                                                                                | CouponAssociations are included when "coupon_associations" is in expand parameter                                                                                                                                                                 |
| `createdAt`                                                                                                                                                                                                                                       | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `createdBy`                                                                                                                                                                                                                                       | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `creditGrants`                                                                                                                                                                                                                                    | [models.CreditGrantResponse](../../sdk/models/credit-grant-response.md)[]                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                | CreditGrants are included when "credit_grants" is in expand parameter                                                                                                                                                                             |
| `currency`                                                                                                                                                                                                                                        | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | Currency is the currency of the subscription in lowercase 3 digit ISO codes                                                                                                                                                                       |
| `currentPeriodEnd`                                                                                                                                                                                                                                | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | CurrentPeriodEnd is the end of the current period that the subscription has been invoiced for.<br/>At the end of this period, a new invoice will be created.                                                                                      |
| `currentPeriodStart`                                                                                                                                                                                                                              | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | CurrentPeriodStart is the end of the current period that the subscription has been invoiced for.<br/>At the end of this period, a new invoice will be created.                                                                                    |
| `customer`                                                                                                                                                                                                                                        | [models.CustomerResponse](../../sdk/models/customer-response.md)                                                                                                                                                                                  | :heavy_minus_sign:                                                                                                                                                                                                                                | Customer response object containing all customer information                                                                                                                                                                                      |
| `customerId`                                                                                                                                                                                                                                      | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | CustomerID is the identifier for the customer in our system                                                                                                                                                                                       |
| `enableTrueUp`                                                                                                                                                                                                                                    | *boolean*                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `endDate`                                                                                                                                                                                                                                         | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | EndDate is the end date of the subscription                                                                                                                                                                                                       |
| `environmentId`                                                                                                                                                                                                                                   | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | EnvironmentID is the environment identifier for the subscription                                                                                                                                                                                  |
| `gatewayPaymentMethodId`                                                                                                                                                                                                                          | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | GatewayPaymentMethodID is the gateway payment method ID for this subscription                                                                                                                                                                     |
| `id`                                                                                                                                                                                                                                              | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | ID is the unique identifier for the subscription                                                                                                                                                                                                  |
| `invoicingCustomerId`                                                                                                                                                                                                                             | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | InvoicingCustomerID is the customer ID to use for invoicing<br/>This can differ from the subscription customer (e.g., parent company invoicing for child company)                                                                                 |
| `lineItems`                                                                                                                                                                                                                                       | [models.SubscriptionLineItemResponse](../../sdk/models/subscription-line-item-response.md)[]                                                                                                                                                      | :heavy_minus_sign:                                                                                                                                                                                                                                | LineItems is expanded only if "subscription_line_items" is in expand parameter<br/>Each line item can optionally include expanded price data                                                                                                      |
| `lookupKey`                                                                                                                                                                                                                                       | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | LookupKey is the key used to lookup the subscription in our system                                                                                                                                                                                |
| `metadata`                                                                                                                                                                                                                                        | Record<string, *string*>                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `overageFactor`                                                                                                                                                                                                                                   | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | OverageFactor is a multiplier applied to usage beyond the commitment amount                                                                                                                                                                       |
| `parentSubscriptionId`                                                                                                                                                                                                                            | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | ParentSubscriptionID is the parent subscription ID for hierarchy (e.g. child subscription under a parent)                                                                                                                                         |
| `pauseStatus`                                                                                                                                                                                                                                     | [models.PauseStatus](../../sdk/models/pause-status.md)                                                                                                                                                                                            | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `pauses`                                                                                                                                                                                                                                          | [models.SubscriptionSubscriptionPause](../../sdk/models/subscription-subscription-pause.md)[]                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | Pauses are included when subscription has pause status                                                                                                                                                                                            |
| `paymentBehavior`                                                                                                                                                                                                                                 | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | PaymentBehavior determines how subscription payments are handled                                                                                                                                                                                  |
| `paymentTerms`                                                                                                                                                                                                                                    | [models.PaymentTerms](../../sdk/models/payment-terms.md)                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `phases`                                                                                                                                                                                                                                          | [models.SubscriptionPhaseResponse](../../sdk/models/subscription-phase-response.md)[]                                                                                                                                                             | :heavy_minus_sign:                                                                                                                                                                                                                                | Phases are included when "phases" is in expand parameter                                                                                                                                                                                          |
| `plan`                                                                                                                                                                                                                                            | [models.PlanResponse](../../sdk/models/plan-response.md)                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `planId`                                                                                                                                                                                                                                          | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | PlanID is the identifier for the plan in our system                                                                                                                                                                                               |
| `planPricesOutOfSync`                                                                                                                                                                                                                             | *boolean*                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                | PlanPricesOutOfSync is true when the subscription's synced_price_sequence<br/>is behind the plan's current max prices.sequence — i.e. plan-price<br/>changes have not yet been reconciled into this subscription's line items.                    |
| `prorationBehavior`                                                                                                                                                                                                                               | [models.ProrationBehavior](../../sdk/models/proration-behavior.md)                                                                                                                                                                                | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `startDate`                                                                                                                                                                                                                                       | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | StartDate is the start date of the subscription                                                                                                                                                                                                   |
| `status`                                                                                                                                                                                                                                          | [models.Status](../../sdk/models/status.md)                                                                                                                                                                                                       | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `subscriptionStatus`                                                                                                                                                                                                                              | [models.SubscriptionStatus](../../sdk/models/subscription-status.md)                                                                                                                                                                              | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `subscriptionType`                                                                                                                                                                                                                                | [models.SubscriptionType](../../sdk/models/subscription-type.md)                                                                                                                                                                                  | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `syncedPriceSequence`                                                                                                                                                                                                                             | *number*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | SyncedPriceSequence is the plan-price sequence up to which this<br/>subscription's line items have been reconciled. Bumped by the<br/>plan-price sync after a successful pass.                                                                    |
| `tenantId`                                                                                                                                                                                                                                        | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `timezone`                                                                                                                                                                                                                                        | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `trialEnd`                                                                                                                                                                                                                                        | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | TrialEnd is the end date of the trial period                                                                                                                                                                                                      |
| `trialStart`                                                                                                                                                                                                                                      | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | TrialStart is the start date of the trial period                                                                                                                                                                                                  |
| `updatedAt`                                                                                                                                                                                                                                       | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `updatedBy`                                                                                                                                                                                                                                       | *string*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | N/A                                                                                                                                                                                                                                               |
| `version`                                                                                                                                                                                                                                         | *number*                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                | Version is used for optimistic locking                                                                                                                                                                                                            |