Retrieve Price Points

Set up price points

Before retrieving your price points for the checkout, ensure that you've set up your price points in the Publisher Dashboard.

Retrieve price points

To retrieve your price points, call the following function:

CheckoutController.Instance.GetPricePoints()

Important: This function must be called during the game's boot process, after the initialization.

If the request is successful, the OnPricePointsSuccess callback is triggered, returning a list of available price points. If the request fails, the OnPricePointsFailed callback is triggered with an error code. Follow the instructions in the WebGL SDK troubleshooting article and try to retrieve your price points again based on the error.

For more details on the callbacks you need to implement and how to handle them, refer to the Implement the WebGL SDK Callbacks article.

Example code

Below is an example response code for the function:

PropertyTypeDescription
pricingPointsArrayList of available price points for the product.
basePriceInUSDStringThe product's base price in USD.
localizedPriceStringThe product's price in the local currency, adjusted by the multiplier.
formattedPriceStringThe localized price in string format.
pricingPointDataObjectCurrency formatting metadata.
currencyCodeStringThe ISO 4217 currency code. For example, USD for United States Dollar.
currencySymbolStringThe symbol representing the currency. For example, "$".
fractionalSeparatorStringThe character used to separate decimal places . For example, "." or ",".
milSeparatorStringThe character used to separate thousands. For example, "," or ".".
symbolPositionStringThe position of the currency symbol. For example, "Right" for after the amount, "Left" for before.
spacingBooleanWhether there is a space between the number and the currency symbol.
multiplierIntegerThe factor by which the localizedPrice is multiplied. In the example below, the localized price is 200 and the multiplier is 100, so the final price will be $2.00.
{
    "pricingPoints": [
        {
            "basePriceInUSD": "200",
            "localizedPrice": "200",
            "formattedPrice": "$2.00"
        },
        {
            "basePriceInUSD": "500",
            "localizedPrice": "500",
            "formattedPrice": "$5.00"
        }
    ],
    "pricingPointData": {
        "currencyCode": "USD",
        "currencySymbol": "$",
        "fractionalSeparator": ".",
        "milSeparator": ",",
        "symbolPosition": "Left",
        "spacing": true,
        "multiplier": 100
    }
}