Studio GuideWorld SDK Guide
Log In

ZEPETO Product API

ZEPETO.Product

Methods

APIDescription
public static GetProductsAsync(...productIds: string[]):BaseRequest$1Asynchronous 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$1Asynchronous 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$1This 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$1It 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$1Asynchronous method for importing a list of currencies. When asynchronous is complete, the CurrentListResponse object is returned.
public static GetCurrencyAsync($currencyId: string):BaseRequest$1Asynchronous 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):voidWhen you deliver the ProductRecord object as a parameter, it opens the official purchase UI for that product.

Events

APIDescription
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.

PropertyTypeDescription
isSuccessbooleanValue indicating success or failure of the request (success: true, failure: false)
messagestringstring representing a message about the result of a request

  • ProductBaseResponse

The ProductBaseResponse class inherits the BaseResponse class.

PropertyTypeDescription
isSuccessbooleanValue indicating success or failure of the request (success: true, failure: false)
messagestringstring representing a message about the result of a request
ErrorCodeSystem.Nullable$1error 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.

PropertyTypeDescription
isSuccessbooleanValue indicating success or failure of the request (success: true, failure: false)
messagestringstring representing a message about the result of a request
productsProductRecord[]product list

Record

  • ProductRecord
PropertyTypeDescription
productIdstringProduct ID
namestringproduct name
pricenumberproduct price
isPurchasedbooleanWhether the user has purchased the product.
itemPackageUnitsItemPackageUnitRecord[]If the ProductType of the product is ItemPackage, it is valid and includes a list of sub Products included in the package.
currencyPackageUnitsCurrencyPackageUnitRecord[]If the ProductType of the product is CurrencyPackage, it is valid and includes a list of sub Currencies included in the package.
ProductTypeProductType enumItem = 0,

ItemPackage = 1

CurrencyPackage = 2
PurchaseTypePurchaseType enumConsumable = 0

NonConsumable = 1
ProductStatusProductStatus enumActive = 0
InActive = 1
Forbidden = 2
CurrencyTypeCurrencyType enumOfficialCurrency = 0

UserCurrency = 1
currencyIdstringID of the currency used in the product
currencyNamestringThe name of the currency used in the product

  • CurrencyRecord
PropertyTypeDescription
currencyIdstringunique ID of the currency
namestringName of the currency
isOfficialCurrencybooleanWhether it is an official currency (true: official currency, false: user-generated currency)

  • ItemPackageUnitRecord

This is information for each Sub Product included in the ItemPackage.

PropertyTypeDescription
productIdstringproduct ID
itemNamestringproduct name
quantitybigintAmount of the product

  • CurrencyPackageUnitRecord

This is information for each Sub Currency included in the CurrencyPackage.

PropertyTypeDescription
currencyIdstringcurrency ID
currencyNamestringcurrency name
quantitybigintcurrency amount

ZEPETO.Currency

Methods

APIDescription
public static GetUserCurrencyBalancesAsync():ZEPETO_Product.BaseRequest$1Returns 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$1Enter 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.OfficialCurrencyBalanceRequestInvokes ZEPETO ZEM balance information.

Response

  • CurrencyBaseResponse

The CurrencyBaseResponse class is the default class that represents the response to requests from the Currency API.

PropertyTypeDescription
ErrorCodeSystem.Nullable$1error 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.

PropertyTypeDescription
currenciesSystem_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
PropertyTypeDescription
currencyBalanceRecordBalanceRecord object that represents the user's currency ID and the balance information of the currency.

Record

  • BalanceRecord
PropertyTypeDescription
currencyIdstringA string representing the user's currency ID
quantitybigintA large integer representing the user balance of the currency

ZEPETO.Inventory

Methods

APIDescription
public static GetListAsync():ZEPETO_Product.BaseRequest$1Provides the ability to asynchronously retrieve a user's inventory list and returns an InventoryListResponse object.
public static GetAsync($productId: string):ZEPETO_Product.BaseRequest$1Provides 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):CheckInventoryRequestProvides 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.

PropertyTypeDescription
ErrorCodeSystem.Nullable$1Error in Inventory-related Request

Unknown = -1,
NetworkError = 0

  • InventoryResponse

InventoryResponseClass is Inventory.BaseResponseInherit the class.

PropertyTypeDescription
productInventoryRecordInventoryRecord 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.

PropertyTypeDescription
responseDataCheckInventoryResponseCheckInventoryResponse object indicating whether a specific product exists in the user's inventory.

  • CheckInventoryResponse

The CheckInventoryResponse object inherits the InventoryBaseResponse class.

PropertyTypeDescription
isExistbooleanBoolean value indicating whether a particular product exists in the user's inventory.

Record

  • InventoryRecord
PropertyTypeDescription
productIdstringA string representing the product ID.
quantitybigintA large integer representing the number of products.
createdAtDateDate object indicating the date and time the product was added to the inventory.
updatedAtDateDate object indicating the date and time when the product information was updated.