인앱결제 구매 웹훅
🔔 최신화 일자: 2025-10-13
구매 이벤트 타입 정의
IapPurchaseEvent
declare interface IapPurchaseEvent {
userId: string;
iapLogId: number;
nachoProductId: string;
os: 'android' | 'ios';
productId: string;
productType: 'consumable' | 'non-consumable';
quantity: number;
price: number;
environment: 'sandbox' | 'production';
data: PlayStorePurchaseData | AppStorePurchaseData;
requestedAt: string;
purchasedAt: string;
verifiedAt: string;
}
| 속성명 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
userId | string | ✅ | 인앱결제를 수행한 앱 사용자의 고유 식별자 |
iapLogId | number | ✅ | 인앱결제 요청의 고유 로그 ID |
nachoProductId | string | ✅ | nachocode에서 발급받은 인앱 상품의 고유 식별자 |
os | 'android' | 'ios' | ✅ | 인앱결제가 이루어진 운영 체제 (android, ios) |
productId | string | ✅ | 스토어에 등록된 상품의 고유 식별자 |
productType | 'consumable' | 'non-consumable' | ✅ | 상품 유형 (consumable: 소모성, non-consumable: 비소모성) |
quantity | number | ✅ | 구매한 상품 개수 |
price | number | ✅ | 개당 구매 가격 |
environment | 'sandbox' | 'production' | ✅ | 구매가 이루어진 환경 (sandbox: 테스트 환경, production: 운영 환경) |
data | PlayStorePurchaseData | AppStorePurchaseData | ✅ | 인앱결제 데이터 정보. os가 'android'인 경우 PlayStorePurchaseData, os가 'ios'인 경우 AppStorePurchaseData |
requestedAt | string (ISO 8601 format) | ✅ | 결제 요청이 발생한 시간 (YYYY-MM-DD'T'HH:mm:ss.sss'Z') |
purchasedAt | string (ISO 8601 format) | ✅ | 결제가 완료된 시간 (YYYY-MM-DD'T'HH:mm:ss.sss'Z') |
verifiedAt | string (ISO 8601 format) | ✅ | 결제 검증이 완료된 시간 (YYYY-MM-DD'T'HH:mm:ss.sss'Z') |