store-24Purchasing/Product APIs

Players can buy products (game passes + consumables) for Sparks in your game. When a purchase happens, All Out calls your purchase handler so you can grant the item or feature.

circle-info

For creating products and viewing analytics, see In Game Products.

Product types (quick overview)

  • Game passes: one-time, persistent unlocks (admin pass, permanent ability, house ownership)

  • Consumables: can be bought multiple times (potion, temporary buff, one-time coin pack)

Product types are configured in the creator portal. See In Game Products.

Purchasing API reference

Product :: struct {
    id: string;
    name: string;
    description: string;
    price: s64;
    consumable: bool;
    icon: Texture_Asset;
}

Purchasing :: struct {
    prompt_purchase :: proc(player: Player, id: string);
    owns_product    :: proc(player: Player, id: string) -> bool;
    get_product     :: proc(id: string) -> Product;
}

Prompting a purchase

To start the purchase flow, call Purchasing.prompt_purchase with a product ID.

circle-info

The product ID is shown in the monetization/products page in the creator portal (you can click to copy it). See In Game Products.

Checking if a player owns a product (game passes)

For game passes, you can gate gameplay features by checking ownership.

circle-info

Consumables can be bought multiple times, owns_product shouldn't be used to award them. Consumables are usually granted in your purchase handler (coins, items, buffs, etc).

Reading product info (name/price/icon)

If you want to show a “Buy” UI or log product info, fetch the product definition by ID:

The purchase handler (granting)

When a player buys a product in your game, All Out calls:

You should:

  • Switch on the product ID

  • Grant the item/feature

  • Return true if the grant succeeded

  • Return false if the grant failed (inventory full, missing prerequisite, etc)

Grant failures & retries

If your purchase handler returns false, the purchase is marked as a grant failure.

  • Grant failures are shown in the creator portal

  • They're automatically retried when the player joins until they succeed

  • You can manually re-run a purchase handler by marking a purchase as “ungranted” in the player data UI

See:

Cross-game (hub + minigames)

If you use game parenting, purchases can be shared across your games. See Cross-Game Products/Data.

Last updated