ZEPETO.Product
Methods
API | Description |
---|---|
public static GetProductsAsync(...productIds: string[]):BaseRequest$1 | Asynchronous method to get the product list.The ProductIds parameter receives the product ID array and returns the BaseRequest object that delivers the ProductListResponse upon asynchronous completion. |
public static GetProductAsync($productId: string):BaseRequest$1 | Asynchronous method for obtaining specific product information.The productId parameter receives the product ID and returns the productResponse object when asynchronous is complete. |
public static PurchaseProductAsync($product: ProductRecord, $reason?: string):BaseRequest$1 | This is an asynchronous method of purchasing a product.The ProductRecord object is entered with the product parameter, and upon asynchronous completion, the PurchaseResponse object containing the result is returned.The reason parameter is optional and can explain the reason for purchase. |
public static PurchaseProductAsync($productId: string, $reason?: string):BaseRequest$1 | It is an asynchronous method of purchasing a product using a product ID.The productId parameter is used to enter the product ID, and upon asynchronous completion, purchase the product and return the PurchaseResponse object containing the result.The reason parameter is optional and can explain the reason for purchase. |
public static GetCurrenciesAsync():BaseRequest$1 | Asynchronous method for importing a list of currencies. When asynchronous is complete, the CurrentListResponse object is returned. |
public static GetCurrencyAsync($currencyId: string):BaseRequest$1 | Asynchronous method for obtaining specific currency information.The currentId parameter receives the currency ID and returns a currentResponse object containing information about the currency when asynchronous is complete. |
public static OpenPurchaseUI($product: ProductRecord):void | When you deliver the ProductRecord object as a parameter, it opens the official purchase UI for that product. |
Events
API | Description |
---|---|
public static OnPurchaseCompleted: UnityEngine_Events.UnityEvent$2<ProductRecord, PurchaseResponse> | event called upon successful purchase You can add a callback function that receives ProductRecord and PurchaseResponse as parameters. - ProductRecord:ProductInformation Purchased - PurchaseResponse: Purchase Results Information |
public static OnPurchaseFailed: UnityEngine_Events.UnityEvent$2<ProductRecord, ProductBaseResponse> | event called upon purchase failure You can add a callback function that receives ProductRecord and ProductBaseResponse as parameters. - ProductRecord: Information about the product that failed to purchase - ProductBaseResponse:Response information for purchasing failures |
Response
- BaseResponse
The BaseResponse class is the default class that represents the response to requests from the Product API.
Property | Type | Description |
---|---|---|
isSuccess | boolean | Value indicating success or failure of the request (success: true, failure: false) |
message | string | string representing a message about the result of a request |
- ProductBaseResponse
The ProductBaseResponse class inherits the BaseResponse class.
Property | Type | Description |
---|---|---|
isSuccess | boolean | Value indicating success or failure of the request (success: true, failure: false) |
message | string | string representing a message about the result of a request |
ErrorCode | System.Nullable$1 | error code (optional value) generated by the request Unknown = -1, NetworkError = 0, UserCanceled = 1, ProductRefreshResponseError = 2, ItemPackageProductsResponseError = 3, IAPCardError = 4, ProductPriceChanged = 4001, ProductAlreadyPurchased = 4002, BalanceOfficialCurrencyNotEnough = 4003, BalanceUserCurrencyNotEnough = 4004, ProductNotActive = 4005, InvalidCreator = 4006 |
- ProductListResponse
The ProductListResponse class inherits the ProductBaseResponse class.
Property | Type | Description |
---|---|---|
isSuccess | boolean | Value indicating success or failure of the request (success: true, failure: false) |
message | string | string representing a message about the result of a request |
products | ProductRecord[] | product list |
Record
- ProductRecord
Property | Type | Description |
---|---|---|
productId | string | Product ID |
name | string | product name |
price | number | product price |
isPurchased | boolean | Whether the user has purchased the product. |
itemPackageUnits | ItemPackageUnitRecord[] | If the ProductType of the product is ItemPackage, it is valid and includes a list of sub Products included in the package. |
currencyPackageUnits | CurrencyPackageUnitRecord[] | If the ProductType of the product is CurrencyPackage, it is valid and includes a list of sub Currencies included in the package. |
ProductType | ProductType enum | Item = 0, ItemPackage = 1 CurrencyPackage = 2 |
PurchaseType | PurchaseType enum | Consumable = 0 NonConsumable = 1 |
ProductStatus | ProductStatus enum | Active = 0 InActive = 1 Forbidden = 2 |
CurrencyType | CurrencyType enum | OfficialCurrency = 0 UserCurrency = 1 |
currencyId | string | ID of the currency used in the product |
currencyName | string | The name of the currency used in the product |
- CurrencyRecord
Property | Type | Description |
---|---|---|
currencyId | string | unique ID of the currency |
name | string | Name of the currency |
isOfficialCurrency | boolean | Whether it is an official currency (true: official currency, false: user-generated currency) |
- ItemPackageUnitRecord
This is information for each Sub Product included in the ItemPackage.
Property | Type | Description |
---|---|---|
productId | string | product ID |
itemName | string | product name |
quantity | bigint | Amount of the product |
- CurrencyPackageUnitRecord
This is information for each Sub Currency included in the CurrencyPackage.
Property | Type | Description |
---|---|---|
currencyId | string | currency ID |
currencyName | string | currency name |
quantity | bigint | currency amount |
ZEPETO.Currency
Methods
API | Description |
---|---|
public static GetUserCurrencyBalancesAsync():ZEPETO_Product.BaseRequest$1 | Returns the BalanceListResponse object containing all user-defined inventory information and the inventory list information of the currency |
public static GetUserCurrencyBalanceAsync($currencyId: string):ZEPETO_Product.BaseRequest$1 | Enter the currency id as a parameter to call the balance information of the currency defined by the user and return the BalanceResponse object containing the balance information of the currency |
public static GetOfficialCurrencyBalanceAsync():ZEPETO_Product.OfficialCurrencyBalanceRequest | Invokes ZEPETO ZEM balance information. |
Response
- CurrencyBaseResponse
The CurrencyBaseResponse class is the default class that represents the response to requests from the Currency API.
Property | Type | Description |
---|---|---|
ErrorCode | System.Nullable$1 | error in the Currency-related request Unknown = -1, NetworkError = 0 |
- BalanceListResponse
BalanceListResponseThe class is...CurrencyBaseResponseInheriting the class,currenciesattribute to each propertyBalanceRecordContains the Dictionary of the object.
Property | Type | Description |
---|---|---|
currencies | System_Collections_Generic.Dictionary$2<string, bigint> | Dictionary object containing balance information for all user's currency. The key is the ID of the currency ID. value is the bigint value that represents the user balance of the currency. |
- BalanceResponse
Property | Type | Description |
---|---|---|
currency | BalanceRecord | BalanceRecord object that represents the user's currency ID and the balance information of the currency. |
Record
- BalanceRecord
Property | Type | Description |
---|---|---|
currencyId | string | A string representing the user's currency ID |
quantity | bigint | A large integer representing the user balance of the currency |
ZEPETO.Inventory
Methods
API | Description |
---|---|
public static GetListAsync():ZEPETO_Product.BaseRequest$1 | Provides the ability to asynchronously retrieve a user's inventory list and returns an InventoryListResponse object. |
public static GetAsync($productId: string):ZEPETO_Product.BaseRequest$1 | Provides the ability to asynchronously retrieve inventory product information for the user corresponding to the product ID delivered by the parameter and returns an InventoryResponse object. |
public static HasAsync($productId: string):CheckInventoryRequest | Provides the ability to verify that the inventory product of the user corresponding to the product ID delivered by the parameter exists and returns the CheckInventoryRequest object. |
Response
- InventoryBaseResponse
The InventoryBaseResponse class is the default class that represents the response to requests from the Inventory API.
Property | Type | Description |
---|---|---|
ErrorCode | System.Nullable$1 | Error in Inventory-related Request Unknown = -1, NetworkError = 0 |
- InventoryResponse
InventoryResponseClass is Inventory.BaseResponseInherit the class.
Property | Type | Description |
---|---|---|
product | InventoryRecord | InventoryRecord object that represents the user's inventory product information for a specific product ID. |
- CheckInventoryRequest
Class to check whether a specific product exists in the user's inventory.This class inherits the ZEPETO_Product.BaseRequest class.
Property | Type | Description |
---|---|---|
responseData | CheckInventoryResponse | CheckInventoryResponse object indicating whether a specific product exists in the user's inventory. |
- CheckInventoryResponse
The CheckInventoryResponse object inherits the InventoryBaseResponse class.
Property | Type | Description |
---|---|---|
isExist | boolean | Boolean value indicating whether a particular product exists in the user's inventory. |
Record
- InventoryRecord
Property | Type | Description |
---|---|---|
productId | string | A string representing the product ID. |
quantity | bigint | A large integer representing the number of products. |
createdAt | Date | Date object indicating the date and time the product was added to the inventory. |
updatedAt | Date | Date object indicating the date and time when the product information was updated. |