Purchases API

Let players spend RunBucks to buy digital goods and entitlements in your game. The SDK handles platform billing flows—your game just requests balances and initiates transactions.

What Are RunBucks?

RunBucks are the platform's hard currency. Players acquire RunBucks through the platform store, then spend them inside games for digital goods, power-ups, cosmetics, or other entitlements.

Note: "In-App Purchases" refers to FIAT transactions on the platform or in-game. This API specifically handles RunBucks purchases—transactions where users spend RunBucks inside your game.

Quick Start

import RundotGameAPI from '@series-inc/rundot-game-sdk/api'

// Check player's RunBucks balance
const balance = await RundotGameAPI.iap.getHardCurrencyBalance()
console.log(`Player has ${balance} RunBucks`)

// Spend RunBucks on an item
const purchase = await RundotGameAPI.iap.spendCurrency('bundle_sword', 1)
if (purchase.success) {
  unlockItem('bundle_sword')
}

Storefront Helpers

Complete Purchase Flow

You can use hasUserMadePurchase to check if the user has ever made a purchase on RUN. You could use this information to adjust prices in your store, or show certain bundles only to non-spenders

Subscription Paywall with Checkout Flow

Checking Subscription Status

Use isUserSubscribed to gate content or features behind a subscription tier. This method respects tier hierarchy—if a user has a higher tier than the one being checked, it returns true. The tier hierarchy is (lowest to highest) Core, Plus, Prime, Ultimate

API Reference

Method
Returns
Description

getHardCurrencyBalance()

Promise<number>

Get player's current RunBucks balance

spendCurrency(itemId, amount)

Promise<{ success, newBalance }>

Spend RunBucks on an item

openStore()

Promise<void>

Open the native RunBucks store

getCurrencyIcon()

Promise<string>

Get the RunBucks icon URL for UI

isUserSubscribed(

tier)

Promise<boolean>

Check if the user has a certain subscription tier. Will also return true if the user has a higher subscription tier.

getSubscriptions(

tier)

Promise<RunSubscriptionsResponse>

Get a list of subscriptions available by tier. Use these to show a paywall to the user. You can optionally pass a tier to this method to get subscriptions for that tier only.

purchaseSubscription(tier, interval)

Promise<PurchaseSubscriptionResponse>

Trigger a checkout flow for a given subscription (identified by its tier and interval

hasUserMadePurchase()

Promise<boolean>

Check if the user has ever made a purchase on RUN


Subscription Offerings

Tier: CORE

Interval
Price

WEEKLY

$1.99

MONTHLY

$7.99

ANNUAL

$79.99


Tier: PLUS

Interval
Price

WEEKLY

$2.99

MONTHLY

$11.99

ANNUAL

$119.99


Tier: PRIME

Interval
Price

WEEKLY

$9.99

MONTHLY

$34.99

ANNUAL

$299.99


Tier: ULTIMATE

Interval
Price

WEEKLY

$14.99

MONTHLY

$39.99

ANNUAL

$349.99

Best Practices

  • Check balances before attempting to spend to avoid bouncing players with generic errors.

  • Handle rejections gracefully—users may cancel or payments can fail mid-flow.

  • Persist receipts or transaction IDs from the result payload if you need audit trails on your backend.

  • Combine with RundotGameAPI.analytics to attribute purchases by SKU.

  • Always show the player's current balance in your shop UI.

Last updated