Orishare
Recipes

Game economy

Add a skin shop, consumables, energy, timed boosts, chests, a battle pass and server-validated match results on top of the game starter.

Everything a player owns that is not a currency is an item: skins, consumables, boosts, chests, energy refills, streak repairs and battle pass premium tokens. The full reference, with a step-by-step recipe (skin shop, energy, chests, battle pass, rules, browser and backend calls), is Economy. Follow it on top of the game starter. The points below are where agents went wrong in testing.

Change sets

  • The commands are economy_item.create, economy_offer.create, economy_loot_table.create, economy_energy.create and economy_battle_pass.create (underscore, then the verb).
  • One operation command per change set (every economy command is one). Propose items before the offers, loot tables and passes that name them.
  • A proposal answers 201 with status: "pending" in every environment. Apply it with POST /v1/change_set_applications { "change_set_id", "plan_digest" }. In the test environment the apply always succeeds; in a live environment it follows the autonomy policy.
  • amount_minor in economy commands is a JSON integer of at least 1 (minor units): "price": { "currency": "coins", "amount_minor": 500 }. The price currency must be spendable (coins in the game starter, not xp).
  • Rules and program reward slots grant items with { "type": "item.grant", "item": "red_cape", "quantity": 1 }.

The player and the backend

  • Shop, inventory, equips, consumptions, energy, chest openings and battle pass claims are customer calls under /v1/customer/... with a session; a backend makes the same calls under /v1/customers/{id}/... with the secret key. Every write takes an Idempotency-Key; a chest opening's loot is fixed by it, so a retry shows the same loot.
  • Battle pass premium is set by your backend after it verifies the purchase: POST /v1/customers/{id}/battle_pass_premium { "pass", "premium": true, "source": { "type", "id" } } with Idempotency-Key: premium-<transaction id>. Premium rewards of tiers already reached become claimable.

Match results and the game starter

POST /v1/match_results (secret key, events:write) checks a game server's result per player against a match profile and admits each player as a trusted match.completed event. Its properties are the profile's numeric metrics plus match_id and match_profile, and won when the report gives it per player ("won": true or false beside metrics). The game starter's win rules (xp_per_win, coins_per_win, the wins badge and the win quest step) test event.properties.won, so send won for every player and they pay as with POST /v1/events. See Match results.

On this page