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

IAP.getSubscriptionInfo

기능 설명

구독 주문의 현재 상태 정보를 가져와요.

파라미터는 { params: { orderId } } 중첩을 유지해요.

토스앱 Android 5.253.0, iOS 5.250.0 이상에서 사용할 수 있어요. 미지원 버전에서 호출하면 UNSUPPORTED_APP_VERSION 에러가 발생해요.

타입

IAP.getSubscriptionInfo(args: { params: { orderId: string } }): Promise<IapSubscriptionInfoResponse>;

Params

{
  params: {
    orderId: string;
  }
}

Response

type IapSubscriptionInfoResponse = {
  subscription: IapSubscriptionInfoResult;
};

type IapSubscriptionInfoResult = {
  catalogId: number;
  status:
    "ACTIVE" | "EXPIRED" | "IN_GRACE_PERIOD" | "ON_HOLD" | "PAUSED" | "REVOKED";
  expiresAt: string | null;
  isAutoRenew: boolean;
  gracePeriodExpiresAt: string | null;
  isAccessible: boolean;
};

에러

에러 코드는 catch한 에러의 error.code 값이에요.

코드
설명

UNSUPPORTED_APP_VERSION

실행 중인 토스앱 버전이 이 기능을 지원하지 않으면 호출 즉시 발생해요. IAP.getSubscriptionInfo.isSupported()로 사전 확인하고, 발생 시 error.message(업데이트 안내 문구)를 사용자에게 보여주세요.

예시 코드

도움이 되었나요?