Skip to main content

Commerce.Price

Class

Represents the price of a product in a Lens.

  • 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.

Represents the price of a product in a Lens.

Index

Extends

Constructors

Constructor

new Price(price, displayPrice, currency): Price

Parameters

ParameterType
pricenumber
displayPricestring
currencystring

Returns

Price

Overrides

ScriptObject.constructor

Properties

currency

readonly currency: string

SPECS

The standard three-letter code that indicates the currency of the price (e.g., "USD" for US Dollars, "EUR" for Euros). It helps ensure that prices are displayed and processed correctly across different regions.


displayPrice

readonly displayPrice: string

SPECS

Provides a pre-formatted string of the product's price, including the appropriate currency symbol and localized formatting (e.g., "$10.99" in the US, "10,99 €" in Europe). This ensures prices are displayed clearly and correctly to users worldwide without requiring manual formatting.


price

readonly price: number

SPECS

The price of the product in cents (e.g., 1099 for $10.99 USD). This format is commonly used for displaying prices.

Methods

getTypeName()

static getTypeName(): TypeName<Price>

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<Price>

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