# SubscriptionTransaction

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

> **Info**

Introduced in 4.10.0. `offerType`, `subscriptionGroupId`, and `store` were added in 4.11.0.



Purpose [#purpose]

Provides details about a single subscription transaction returned from [`CustomerInfo`](/docs/ios/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;The product identifier for the subscription.&#x22;,
    required: true,
  },
  purchaseDate: {
    type: &#x22;Date&#x22;,
    description: &#x22;When the App 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;Date?&#x22;,
    description: &#x22;Expiration date, if applicable.&#x22;,
  },
  offerType: {
    type: &#x22;LatestSubscription.OfferType?&#x22;,
    description: &#x22;Offer applied to this transaction (4.11.0+).&#x22;,
  },
  subscriptionGroupId: {
    type: &#x22;String?&#x22;,
    description: &#x22;Subscription group identifier if available (4.11.0+).&#x22;,
  },
  store: {
    type: &#x22;ProductStore&#x22;,
    description: &#x22;Store that fulfilled the purchase (4.11.0+).&#x22;,
    required: true,
  },
}"
/>

Offer types [#offer-types]

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

Store values [#store-values]

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

Usage [#usage]

Inspect subscription transactions:

```swift
let customerInfo = Superwall.shared.customerInfo

for subscription in customerInfo.subscriptions {
  print("Product: \(subscription.productId)")
  print("Store: \(subscription.store)")
  print("Offer: \(subscription.offerType?.rawValue ?? "none")")
  print("Group: \(subscription.subscriptionGroupId ?? "unknown")")
  print("Expires: \(String(describing: subscription.expirationDate))")
}
```

Related [#related]

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