Documentation

PurchasesApi

Import

Import

  • const { PurchasesApi } = require("@unity-services/economy-2.0");

Constructors

Constructor

Methods

Make Virtual Purchase

  • Enact a virtual purchase for a player.

    summary

    Make purchase

    throws

    {RequiredError}

    memberof

    PurchasesApi

    Parameters

    Returns Promise<AxiosResponse<PlayerPurchaseVirtualResponse>>

Redeem Apple App Store Purchase

  • Redeem an Apple App Store purchase for a player.

    summary

    Redeem Apple App Store Purchase

    throws

    {RequiredError}

    memberof

    PurchasesApi

    Parameters

    • projectId: string

      ID of the project

    • playerId: string

      ID of the player

    • Optional playerPurchaseAppleappstoreRequest: PlayerPurchaseAppleappstoreRequest
    • Optional options: any

    Returns Promise<AxiosResponse<PlayerPurchaseAppleappstoreResponse>>

Redeem Google Play Purchase

  • Redeem a Google Play store purchase for a player.

    summary

    Redeem Google Play Purchase

    throws

    {RequiredError}

    memberof

    PurchasesApi

    Parameters

    Returns Promise<AxiosResponse<PlayerPurchaseGoogleplaystoreResponse>>