Subscription

data class Subscription(val isActive: Boolean, val vendorProductId: String, val vendorTransactionId: String?, val vendorOriginalTransactionId: String?, val offerId: String?, val store: String, val activatedAt: String, val renewedAt: String?, val expiresAt: String?, val startsAt: String?, val isLifetime: Boolean, val activeIntroductoryOfferType: String?, val activePromotionalOfferType: String?, val activePromotionalOfferId: String?, val willRenew: Boolean, val isInGracePeriod: Boolean, val unsubscribedAt: String?, val billingIssueDetectedAt: String?, val isSandbox: Boolean, val isRefund: Boolean, val cancellationReason: String?)

Represents a subscription purchase of the user.

Constructors

Link copied to clipboard
constructor(isActive: Boolean, vendorProductId: String, vendorTransactionId: String?, vendorOriginalTransactionId: String?, offerId: String?, store: String, activatedAt: String, renewedAt: String?, expiresAt: String?, startsAt: String?, isLifetime: Boolean, activeIntroductoryOfferType: String?, activePromotionalOfferType: String?, activePromotionalOfferId: String?, willRenew: Boolean, isInGracePeriod: Boolean, unsubscribedAt: String?, billingIssueDetectedAt: String?, isSandbox: Boolean, isRefund: Boolean, cancellationReason: String?)

Properties

Link copied to clipboard

Activation date in ISO 8601 format.

Link copied to clipboard

Type of active introductory offer, if any. If the value is not null, it means that the offer was applied during the current subscription period. Possible values: free_trial, pay_as_you_go, pay_up_front

Link copied to clipboard

Active promotional offer ID, if any.

Link copied to clipboard

A type of an active promotional offer. If the value is not null, it means that the offer was applied during the current subscription period. Possible values: free_trial, pay_as_you_go, pay_up_front

Link copied to clipboard

Time when a billing issue was detected. Subscription can still be active.

Link copied to clipboard

Reason for cancellation, if any.

Link copied to clipboard

Time when the access level will expire (could be in the past and could be null for lifetime access).

Link copied to clipboard

Whether the subscription is active.

Link copied to clipboard

Whether the subscription is currently in grace period.

Link copied to clipboard

Whether this is a lifetime subscription.

Link copied to clipboard

Whether this subscription was refunded.

Link copied to clipboard

Whether this subscription was made in a sandbox environment.

Link copied to clipboard

Promotional or introductory offer ID, if any.

Link copied to clipboard

Time when the subscription was renewed. It can be null if the purchase was first in chain or it is non-renewing subscription.

Link copied to clipboard

Time when the subscription has started (could be in the future).

Link copied to clipboard

Store name (App Store, Google Play, etc.). Possible values: app_store, play_store, adapty

Link copied to clipboard

Time when the auto-renewable subscription was cancelled. Subscription can still be active, it means that auto-renewal is turned off. Would be null if a user reactivates the subscription.

Link copied to clipboard

An original transaction id of the purchase in a store that unlocked this subscription. For auto-renewable subscription, this will be an id of the first transaction in this subscription

Link copied to clipboard

An identifier of a product in a store that unlocked this subscription.

Link copied to clipboard

A transaction id of a purchase in a store that unlocked this subscription.

Link copied to clipboard

Whether the subscription will automatically renew.