# SubscriptionTransaction

Represents a subscription transaction in the customer's purchase history.

> **Info**

The `offerType`, `subscriptionGroupId`, and `store` fields were added in 2.4.7.



Purpose [#purpose]

Provides details about a single subscription transaction returned from [`CustomerInfo`](/docs/flutter/sdk-reference/CustomerInfo). Use this to understand renewal status, applied offers, and the store that fulfilled the purchase.

Properties [#properties]

<TypeTable
  type="{
  transactionId: {
    type: &#x22;String&#x22;,
    description: &#x22;Unique identifier for the transaction.&#x22;,
    required: true,
  },
  productId: {
    type: &#x22;String&#x22;,
    description: &#x22;Product identifier for the subscription.&#x22;,
    required: true,
  },
  purchaseDate: {
    type: &#x22;DateTime&#x22;,
    description: &#x22;When the store charged the account.&#x22;,
    required: true,
  },
  willRenew: {
    type: &#x22;bool&#x22;,
    description: &#x22;Whether the subscription is set to auto-renew.&#x22;,
    required: true,
  },
  isRevoked: {
    type: &#x22;bool&#x22;,
    description: &#x22;`true` if the transaction has been revoked.&#x22;,
    required: true,
  },
  isInGracePeriod: {
    type: &#x22;bool&#x22;,
    description: &#x22;`true` if the subscription is in grace period.&#x22;,
    required: true,
  },
  isInBillingRetryPeriod: {
    type: &#x22;bool&#x22;,
    description: &#x22;`true` if the subscription is in billing retry.&#x22;,
    required: true,
  },
  isActive: {
    type: &#x22;bool&#x22;,
    description: &#x22;`true` when the subscription is currently active.&#x22;,
    required: true,
  },
  expirationDate: {
    type: &#x22;DateTime?&#x22;,
    description: &#x22;Expiration date, if applicable.&#x22;,
  },
  offerType: {
    type: &#x22;LatestSubscriptionOfferType?&#x22;,
    description: &#x22;Offer applied to this transaction (2.4.7+).&#x22;,
  },
  subscriptionGroupId: {
    type: &#x22;String?&#x22;,
    description: &#x22;Subscription group identifier, if available (2.4.7+).&#x22;,
  },
  store: {
    type: &#x22;ProductStore?&#x22;,
    description: &#x22;Store that fulfilled the purchase (2.4.7+).&#x22;,
  },
}"
/>

Offer types (2.4.7+) [#offer-types-247]

* `trial` - introductory offer.
* `code` - offer redeemed with a promo code.
* `promotional` - promotional offer.
* `winback` - win-back offer (iOS 17.2+ only).

Store values (2.4.7+) [#store-values-247]

`appStore`, `stripe`, `paddle`, `playStore`, `superwall`, `other`.

Usage [#usage]

Inspect subscription transactions:

```dart
final customerInfo = await Superwall.shared.getCustomerInfo();

for (final subscription in customerInfo.subscriptions) {
  print('Product: ${subscription.productId}');
  print('Active: ${subscription.isActive}');
  print('Store: ${subscription.store}');
  print('Offer: ${subscription.offerType}');
  print('Group: ${subscription.subscriptionGroupId ?? "unknown"}');
}
```

Related [#related]

* [`CustomerInfo`](/docs/flutter/sdk-reference/CustomerInfo) - Source of subscription data
* [`NonSubscriptionTransaction`](/docs/flutter/sdk-reference/NonSubscriptionTransaction) - Non-subscription transactions
* [`getCustomerInfo()`](/docs/flutter/sdk-reference/getCustomerInfo) - Fetch customer info