---
title: ZEPETO.Product
slug: world-sdk-guide-ja/zepetoproduct
docTags: 
createdAt: 2026-09-04T06:30:42.917Z
---

| 型                                                                   | 説明                                                                                            |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [BaseResponse](./#baseresponse)                                     | レスポンスクラスの基底クラス。                                                                               |
| [BaseRequest](./#baserequest)                                       | レスポンスデータとしてジェネリック型 `TResponse` を受け取る `BaseRequest` クラス。                                       |
| [ProductListResponse](./#productlistresponse)                       | `ProductListResponse` クラスは、API 呼び出しの結果と、取得した商品情報のリストを提供します。                                   |
| [ProductBaseResponse](./#productbaseresponse)                       | 商品関連のレスポンスクラスの基底クラス。                                                                          |
| [ProductResponse](./#productresponse)                               | `ProductResponse` クラスは、API 呼び出しの結果と、取得した商品情報を提供します。                                           |
| [PurchaseResponse](./#purchaseresponse)                             | `ProductResponse` クラスは、API 呼び出しの結果と、購入情報を提供します。                                               |
| [CurrencyListResponse](./#currencylistresponse)                     | `CurrencyListResponse` クラスは、API 呼び出しの結果と、通貨情報のリストを提供します。                                      |
| [CurrencyResponse](./#currencyresponse)                             | `CurrencyResponse` クラスは、API 呼び出しの結果と、通貨情報を提供します。                                              |
| [ProductRecord](./#productrecord)                                   | 商品情報。                                                                                         |
| [CurrencyRecord](./#currencyrecord)                                 | 通貨情報。                                                                                         |
| [ItemPackageUnitRecord](./#itempackageunitrecord)                   | アイテム商品パッケージに含まれる個々の商品の詳細。                                                                     |
| [CurrencyPackageUnitRecord](./#currencypackageunitrecord)           | 通貨商品パッケージに含まれる個々の通貨の詳細。                                                                       |
| [ProductType](./#producttype)                                       | 商品タイプを表す列挙型。                                                                                  |
| [PurchaseType](./#purchasetype)                                     | 商品の購入タイプを表す列挙型。                                                                               |
| [ProductStatus](./#productstatus)                                   | 商品の状態を表す列挙型。                                                                                  |
| [CurrencyType](./#currencytype)                                     | 通貨の種類を表す列挙型。                                                                                  |
| [ProductService](./#productservice)                                 | `ProductService` は、World 内商品に関連する操作を管理します。 このサービスを通じて、プレイヤーは World 内商品の情報にアクセスし、購入を行うことができます。 |
| [ProductPurchaseButton](./#productpurchasebutton)                   | World 内商品の購入ボタンの機能を管理するクラス。                                                                   |
| [ProductError](./#producterror)                                     | 商品関連のリクエストが失敗した理由を示すエラーコード。                                                                   |
| [OfficialCurrencyBalanceRequest](./#officialcurrencybalancerequest) | ZEPETO の公式通貨 (ZEM) の残高を取得するための非同期リクエストを表します。                                                  |

## BaseResponse

`class`

レスポンスクラスの基底クラス。

### プロパティ

| 名前        | 型         | 説明                                       |
| --------- | --------- | ---------------------------------------- |
| isSuccess | `boolean` | リクエストの成功状態を表します。正常に完了した場合は true が設定されます。 |
| message   | `string`  | リクエストの結果を説明します。                          |

## BaseRequest

`class` · extends `BaseAPIRequest`

レスポンスデータとしてジェネリック型 `TResponse` を受け取る `BaseRequest` クラス。

### プロパティ

| 名前           | 型           | 説明                             |
| ------------ | ----------- | ------------------------------ |
| responseData | `TResponse` | ジェネリック型 `TResponse` のレスポンスデータ。 |

## ProductListResponse

`class` · extends [ProductBaseResponse](./#productbaseresponse)

`ProductListResponse` クラスは、API 呼び出しの結果と、取得した商品情報のリストを提供します。

### プロパティ

| 名前       | 型                                     | 説明        |
| -------- | ------------------------------------- | --------- |
| products | [ProductRecord\[\]](./#productrecord) | 商品情報のリスト。 |

## ProductBaseResponse

`class` · extends [BaseResponse](./#baseresponse)

商品関連のレスポンスクラスの基底クラス。

### プロパティ

| 名前        | 型                               | 説明                        |
| --------- | ------------------------------- | ------------------------- |
| ErrorCode | [ProductError](./#producterror) | 失敗した商品リクエストのエラーコードを取得します。 |

## ProductResponse

`class` · extends [ProductBaseResponse](./#productbaseresponse)

`ProductResponse` クラスは、API 呼び出しの結果と、取得した商品情報を提供します。

### プロパティ

| 名前      | 型                                 | 説明    |
| ------- | --------------------------------- | ----- |
| product | [ProductRecord](./#productrecord) | 商品情報。 |

## PurchaseResponse

`class` · extends [ProductBaseResponse](./#productbaseresponse)

`ProductResponse` クラスは、API 呼び出しの結果と、購入情報を提供します。

### プロパティ

| 名前          | 型        | 説明                   |
| ----------- | -------- | -------------------- |
| userId      | `string` | 購入を行ったプレイヤーのユーザー ID。 |
| productId   | `string` | 購入した World 内商品の ID。  |
| price       | `number` | 購入した World 内商品の価格。   |
| receiptId   | `string` | 購入のレシート ID。          |
| purchasedAt | `Date`   | World 内商品を購入した日時。    |

## CurrencyListResponse

`class` · extends [ProductBaseResponse](./#productbaseresponse)

`CurrencyListResponse` クラスは、API 呼び出しの結果と、通貨情報のリストを提供します。

### プロパティ

| 名前         | 型                                       | 説明        |
| ---------- | --------------------------------------- | --------- |
| currencies | [CurrencyRecord\[\]](./#currencyrecord) | 通貨情報のリスト。 |

## CurrencyResponse

`class` · extends [ProductBaseResponse](./#productbaseresponse)

`CurrencyResponse` クラスは、API 呼び出しの結果と、通貨情報を提供します。

### プロパティ

| 名前       | 型                                   | 説明    |
| -------- | ----------------------------------- | ----- |
| currency | [CurrencyRecord](./#currencyrecord) | 通貨情報。 |

## ProductRecord

`class`

商品情報。

### プロパティ

| 名前                   | 型                                                             | 説明                                               |
| -------------------- | ------------------------------------------------------------- | ------------------------------------------------ |
| productId            | `string`                                                      | 商品の ID。                                          |
| name                 | `string`                                                      | 商品名。                                             |
| price                | `number`                                                      | 商品の価格。                                           |
| isPurchased          | `boolean`                                                     | ユーザーがその商品を購入済みかどうかを示します。非消費型商品にのみ適用されます。         |
| itemPackageUnits     | [ItemPackageUnitRecord\[\]](./#itempackageunitrecord)         | `ProductType` が `ItemPackage` の場合、商品に含まれるアイテム。   |
| currencyPackageUnits | [CurrencyPackageUnitRecord\[\]](./#currencypackageunitrecord) | `ProductType` が `CurrencyPackage` の場合、商品に含まれる通貨。 |
| ProductType          | [ProductType](./#producttype)                                 | 商品の `ProductType` を返します。                         |
| PurchaseType         | [PurchaseType](./#purchasetype)                               | 商品の `PurchaseType` を返します。                        |
| ProductStatus        | [ProductStatus](./#productstatus)                             | 商品の `ProductStatus` を返します。                       |
| CurrencyType         | [CurrencyType](./#currencytype)                               | 商品の購入に使用される通貨の種類を返します。                           |
| currencyId           | `string`                                                      | 商品の購入に使用される通貨の ID を返します。                         |
| currencyName         | `string`                                                      | 商品の購入に使用される通貨の名前を返します。                           |

### メソッド

### GetCurrencySprite

`GetCurrencySprite() → Sprite`

商品の購入に使用される通貨の画像を返します。

**戻り値:** `Sprite`

## CurrencyRecord

`class`

通貨情報。

### プロパティ

| 名前                 | 型         | 説明                                          |
| ------------------ | --------- | ------------------------------------------- |
| currencyId         | `string`  | 通貨の ID。                                     |
| name               | `string`  | 通貨名。                                        |
| isOfficialCurrency | `boolean` | その通貨が ZEPETO の公式通貨 (ZEM) か、World 内通貨かを示します。 |

## ItemPackageUnitRecord

`class`

アイテム商品パッケージに含まれる個々の商品の詳細。

### プロパティ

| 名前        | 型        | 説明       |
| --------- | -------- | -------- |
| productId | `string` | 商品の ID。  |
| itemName  | `string` | アイテム名。   |
| quantity  | `bigint` | アイテムの数量。 |

## CurrencyPackageUnitRecord

`class`

通貨商品パッケージに含まれる個々の通貨の詳細。

### プロパティ

| 名前           | 型        | 説明      |
| ------------ | -------- | ------- |
| currencyId   | `string` | 通貨の ID。 |
| currencyName | `string` | 通貨名。    |
| quantity     | `bigint` | 通貨の数量。  |

## ProductType

`enum`

商品タイプを表す列挙型。

| 名前              | 値 | 説明                     |
| --------------- | - | ---------------------- |
| Item            | 0 | 単一アイテムの商品。             |
| ItemPackage     | 1 | 複数のアイテムを含むアイテム商品パッケージ。 |
| CurrencyPackage | 2 | 複数の通貨を含む通貨商品パッケージ。     |

## PurchaseType

`enum`

商品の購入タイプを表す列挙型。

| 名前            | 値 | 説明      |
| ------------- | - | ------- |
| Consumable    | 0 | 消費型商品。  |
| NonConsumable | 1 | 非消費型商品。 |

## ProductStatus

`enum`

商品の状態を表す列挙型。

| 名前        | 値 | 説明                 |
| --------- | - | ------------------ |
| Active    | 0 | 有効な状態。             |
| InActive  | 1 | 無効な状態。             |
| Forbidden | 2 | 利用期間の満了により禁止された状態。 |

## CurrencyType

`enum`

通貨の種類を表す列挙型。

| 名前               | 値 | 説明                 |
| ---------------- | - | ------------------ |
| OfficialCurrency | 0 | ZEPETO の公式通貨 (ZEM) |
| UserCurrency     | 1 | World 内通貨。         |

## ProductService

`class`

`ProductService` は、World 内商品に関連する操作を管理します。
このサービスを通じて、プレイヤーは World 内商品の情報にアクセスし、購入を行うことができます。

### イベント

| 名前                           | 型                                                | 説明                                                                                                                      |
| ---------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| OnPurchaseCompleted (static) | `UnityEvent<ProductRecord, PurchaseResponse>`    | World 内商品の購入が成功したときに発生するイベント。リスナーを追加でき、`ProductRecord`（購入した商品の情報）と `PurchaseResponse`（購入結果の情報）のインスタンスが引数として渡されます。       |
| OnPurchaseFailed (static)    | `UnityEvent<ProductRecord, ProductBaseResponse>` | World 内商品の購入が失敗したときに発生するイベント。リスナーを追加でき、`ProductRecord`（購入を試みた商品の情報）と `PurchaseResponse`（失敗した購入結果の情報）のインスタンスが引数として渡されます。 |

### メソッド

### GetProductsAsync

`static GetProductsAsync(productIds: string[]) → BaseRequest<ProductListResponse>`

指定された商品 ID に基づいて、World 内商品のリストを非同期で取得するメソッドです。

| パラメーター     | 型          | 説明             |
| ---------- | ---------- | -------------- |
| productIds | `string[]` | 取得する複数の商品の ID。 |

**戻り値:** [BaseRequest\<ProductListResponse>](./#baserequest) — `BaseRequest` オブジェクト。非同期処理が完了すると、`responseData` プロパティから `ProductListResponse` オブジェクトにアクセスできます。

### GetProductAsync

`static GetProductAsync(productId: string) → BaseRequest<ProductResponse>`

指定された商品 ID に基づいて、World 内商品の情報を非同期で取得するメソッドです。

| パラメーター    | 型        | 説明          |
| --------- | -------- | ----------- |
| productId | `string` | 取得する商品の ID。 |

**戻り値:** [BaseRequest\<ProductResponse>](./#baserequest) — `BaseRequest` オブジェクト。非同期処理が完了すると、`responseData` プロパティから `ProductResponse` オブジェクトにアクセスできます。

### PurchaseProductAsync

`static PurchaseProductAsync(product: ProductRecord, reason?: string) → BaseRequest<PurchaseResponse>`

指定された商品情報に基づいて、World 内商品の購入を非同期で行うメソッドです。

| パラメーター        | 型                                 | 説明                              |
| ------------- | --------------------------------- | ------------------------------- |
| product       | [ProductRecord](./#productrecord) | 購入する商品の `ProductRecord` インスタンス。 |
| reason (省略可能) | `string`                          | 購入の説明。                          |

**戻り値:** [BaseRequest\<PurchaseResponse>](./#baserequest) — `BaseRequest` オブジェクト。非同期処理が完了すると、`responseData` プロパティから `PurchaseResponse` オブジェクトにアクセスできます。

### PurchaseProductAsync

`static PurchaseProductAsync(productId: string, reason?: string) → BaseRequest<PurchaseResponse>`

指定された商品 ID に基づいて、World 内商品の購入を非同期で行うメソッドです。

| パラメーター        | 型        | 説明          |
| ------------- | -------- | ----------- |
| productId     | `string` | 購入する商品の ID。 |
| reason (省略可能) | `string` | 購入の説明。      |

**戻り値:** [BaseRequest\<PurchaseResponse>](./#baserequest) — `BaseRequest` オブジェクト。非同期処理が完了すると、`responseData` プロパティから `PurchaseResponse` オブジェクトにアクセスできます。

### GetCurrenciesAsync

`static GetCurrenciesAsync() → BaseRequest<CurrencyListResponse>`

通貨のリストを取得する非同期メソッドです。
処理が完了すると通貨のリストが得られ、`responseData` プロパティから `CurrencyListResponse` オブジェクトにアクセスできます。

**戻り値:** [BaseRequest\<CurrencyListResponse>](./#baserequest)

### GetCurrencyAsync

`static GetCurrencyAsync(currencyId: string) → BaseRequest<CurrencyResponse>`

指定された商品 ID に基づいて、World 内通貨の情報を非同期で取得するメソッドです。

| パラメーター     | 型        | 説明          |
| ---------- | -------- | ----------- |
| currencyId | `string` | 取得する通貨の ID。 |

**戻り値:** [BaseRequest\<CurrencyResponse>](./#baserequest) — `BaseRequest` オブジェクト。非同期処理が完了すると、`responseData` プロパティから `CurrencyResponse` オブジェクトにアクセスできます。

### OpenPurchaseUI

`static OpenPurchaseUI(product: ProductRecord) → void`

このメソッドは、World 内商品の購入 UI を開きます。

| パラメーター  | 型                                 | 説明                              |
| ------- | --------------------------------- | ------------------------------- |
| product | [ProductRecord](./#productrecord) | 購入する商品の `ProductRecord` インスタンス。 |

## ProductPurchaseButton

`class`

World 内商品の購入ボタンの機能を管理するクラス。

### プロパティ

| 名前        | 型                                 | 説明                                   |
| --------- | --------------------------------- | ------------------------------------ |
| productId | `string`                          | 購入可能な World 内商品の ID を取得します。          |
| product   | [ProductRecord](./#productrecord) | `productId` に紐づく World 内商品の情報を取得します。 |

### メソッド

### SetProductId

`SetProductId(productId: string) → void`

このボタンで購入できる World 内商品の ID を設定します。

| パラメーター    | 型        | 説明      |
| --------- | -------- | ------- |
| productId | `string` | 商品の ID。 |

## ProductError

`enum`

商品関連のリクエストが失敗した理由を示すエラーコード。

| 名前                               | 値    | 説明                                                                                    |
| -------------------------------- | ---- | ------------------------------------------------------------------------------------- |
| Unknown                          | -1   | エラー: 不明なエラー。                                                                          |
| NetworkError                     | 0    | エラー: 接続の切断や不安定な接続など、ネットワークに関連するエラー。                                                   |
| UserCanceled                     | 1    | エラー: リクエストがユーザーによってキャンセルされました。                                                        |
| ProductRefreshResponseError      | 2    | エラー: リクエスト内の商品メタデータが無効です。                                                             |
| ItemPackageProductsResponseError | 3    | エラー: アイテム商品パッケージ内の 1 つ以上のアイテム情報の取得に失敗しました。                                            |
| IAPCardError                     | 4    | エラー: 通貨商品パッケージ内の 1 つ以上の通貨情報の取得に失敗しました。                                                |
| ProductPriceChanged              | 4001 | エラー: 商品の価格が一致しません。                                                                    |
| ProductAlreadyPurchased          | 4002 | エラー: 商品はすでに購入済みです。                                                                    |
| BalanceOfficialCurrencyNotEnough | 4003 | エラー: 購入に必要な ZEPETO の公式通貨 (ZEM) の残高が不足しています。                                           |
| BalanceUserCurrencyNotEnough     | 4004 | エラー: 購入に必要な World 内通貨の残高が不足しています。                                                     |
| ProductNotActive                 | 4005 | エラー: 商品が有効ではありません。                                                                    |
| InvalidCreator                   | 4006 | エラー: プレイヤーのユーザー ID が World クリエイターのユーザー ID と異なります。このエラーは Unity エディターを使用する開発環境でのみ発生します。 |

## OfficialCurrencyBalanceRequest

`class` · extends [BaseRequest\<BalanceResponse>](./#baserequest)

ZEPETO の公式通貨 (ZEM) の残高を取得するための非同期リクエストを表します。
