For the complete documentation index, see llms.txt. This page is also available as Markdown.

IAP.getProductItemList

Feature description

Fetches the list of products available for purchase via in-app purchase. Called when entering the product list screen.

Toss app Android/iOS 5.219.0 It can be used on versions above. If called in an unsupported version, UNSUPPORTED_APP_VERSION an error occurs.

Type

IAP.getProductItemList(): Promise<{ products: IapProductListItem[] }>;

Params

None

Response

type ConsumableProductListItem = {
  sku: string;
  type: "CONSUMABLE";
  displayName: string;
  displayAmount: string;
  iconUrl: string;
  description: string;
};

type NonConsumableProductListItem = {
  sku: string;
  type: "NON_CONSUMABLE";
  displayName: string;
  displayAmount: string;
  iconUrl: string;
  description: string;
};

type Offer =
  | { type: "FREE_TRIAL"; offerId: string; period: string }
  | {
      type: "NEW_SUBSCRIPTION";
      offerId: string;
      period: string;
      displayAmount: string;
    }
  | {
      type: "RETURNING";
      offerId: string;
      period: string;
      displayAmount: string;
    };

type SubscriptionProductListItem = {
  sku: string;
  type: "SUBSCRIPTION";
  displayName: string;
  displayAmount: string;
  iconUrl: string;
  description: string;
  renewalCycle: "WEEKLY" | "MONTHLY" | "YEARLY";
  offers?: Offer[];
};

type IapProductListItem =
  | ConsumableProductListItem
  | NonConsumableProductListItem
  | SubscriptionProductListItem;

Error

The error code is the error.code value.

Code
Description

UNSUPPORTED_APP_VERSION

If the running version of the Toss app doesn't support this feature, it occurs immediately upon call. IAP.getProductItemList.isSupported()Check in advance with error.messageand, if it occurs, show the user the (update guidance message).

Example code

Was this helpful?