Preparing search index...

    Class SubscriptionOfferDetails

    Describes a specific offer for a subscription product, such as a base plan or a promotional plan with a trial. A single subscription product can expose multiple offers through Product#subscriptionOfferDetails.

    Lens Scripting Version 377

    async function printSubscriptionOffers(client: Commerce.Client, productId: string) {
    const products = await client.queryProductDetails([productId]);
    const offers = products[0]?.subscriptionOfferDetails || [];
    offers.forEach((offer: Commerce.SubscriptionOfferDetails) => {
    print(`Offer ${offer.offerId} (base plan: ${offer.basePlanId})`);
    });
    }

    Hierarchy (View Summary)

    Index

    Properties

    basePlanId: string

    Identifier of the base plan this offer belongs to (for example, "monthly-basic" or "annual-premium").

    Lens Scripting Version 377

    offerId: string

    Opaque identifier for this offer. Pass it back unchanged when launching a purchase for a specific plan or when updating a subscription.

    Lens Scripting Version 377

    pricingPhases: PricingPhase[]

    The pricing phases for this offer in the order they apply, ending with the recurring phase.

    Lens Scripting Version 377

    promotionId: string

    Optional identifier of the promotional offer. It is not set for base plans.

    Lens Scripting Version 377

    Methods

    • Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

      Returns string

      Lens Scripting Version 377

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean