Skip to main content

Commerce.SubscriptionOfferDetails

Class

Describes a specific offer for a subscription product, such as a base plan or a promotional plan with a trial.

  • Snapchat: not supported
  • SPECS: fully supported
  • Camera Kit Web: not supported
  • Camera Kit Mobile: not supported
  • SnapchatNot supported — Available on SPECS only
  • SPECSFully supported
  • Camera Kit WebNot supported — Available on SPECS only
  • Camera Kit MobileNot supported — Available on SPECS only

Platform details

  • Snapchat — Not supported — Available on SPECS only.

  • SPECS — Fully supported.

  • Camera Kit Web — Not supported — Available on SPECS only.

  • Camera Kit Mobile — Not supported — Available on SPECS only.

Since Lens Scripting v377

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.

Index

Example

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})`);
});
}

Extends

Properties

basePlanId

readonly basePlanId: string

SPECS

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

Since

Lens Scripting Version 377


offerId

readonly offerId: string

SPECS

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

Since

Lens Scripting Version 377


pricingPhases

readonly pricingPhases: PricingPhase[]

SPECS

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

Since

Lens Scripting Version 377


promotionId

readonly promotionId: string

SPECS

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

Since

Lens Scripting Version 377

Methods

getTypeName()

static getTypeName(): TypeName<SubscriptionOfferDetails>

SPECS

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

TypeName<SubscriptionOfferDetails>

Since

Lens Scripting Version 377

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

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

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

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

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame