Commerce.SubscriptionOfferDetails
ClassDescribes 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
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
Properties
Methods
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
readonlybasePlanId:string
SPECS
Identifier of the base plan this offer belongs to (for example, "monthly-basic" or "annual-premium").
Since
Lens Scripting Version 377
offerId
readonlyofferId: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
readonlypricingPhases:PricingPhase[]
SPECS
The pricing phases for this offer in the order they apply, ending with the recurring phase.
Since
Lens Scripting Version 377
promotionId
readonlypromotionId:string
SPECS
Optional identifier of the promotional offer. It is not set for base plans.
Since
Lens Scripting Version 377
Methods
getTypeName()
staticgetTypeName():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
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
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
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean