Game ideas & features

Your next feature

Marketplace

Trade an original inventory item between two players.

SDK developRequires a player session
Unity
Illustration of Marketplace
Your visible result

The buyer receives the same item and the seller receives the agreed price minus the configured fee.

Video coming later

This step does not have a video yet. The guide and MCP request are ready to use.

Marketplace

Prepare the same project

  1. Choose the same project in the dashboard as in your game configuration.

    Marketplace →
  2. No additional definition is needed for the first request. An empty result is valid until matching game data exists.

    Set a currency, a fee and at least one active item price rule.

    Use two signed-in players in the same project. Configure the currency, fee and item price rule, then list one unequipped item and explicitly confirm its purchase.

    Items →Player values →

Build this feature

You can preview the guide. Running it requires an active project key. Prepare project

SDK installed, project configuration imported and player signed in.

This SDK example uses develop. Check whether the required APIs exist in your installed SDK.

Complete the Quickstart connection with the intended player. Call ReadListing(listingId) from an explicit button or scene action. Opening the file alone sends no request.

C#
Assets/Scripts/MarketplaceDemo.cs
horizOn call
1using System.Threading.Tasks;
2using UnityEngine;
3using PM.horizOn.Cloud.Examples.Features;
4using PM.horizOn.Cloud.Objects.Network.Responses;
5​
6public class MarketplaceDemo : MonoBehaviour
7{
8 // Import the SDK Examples sample. Bind its screen to the signed-in player
9 // and set the stable projectId in the Inspector. Never use an Account Key.
10 public MarketplaceExample screen;
11​
12 public Task<MarketplaceResult<MarketplaceListingView>> ReadListing(string listingId)
13 => MarketplaceQuickstart.ReadOneListing(screen, listingId);
14​
15 // Wire only to the player's Buy confirmation after displaying ReadListing.
16 public Task<bool> ConfirmPurchase(string listingId)
17 => MarketplaceQuickstart.BuyReviewedListing(screen, listingId);
18​
19 // false/timeout does not prove nonexecution. Use screen.RetryPending() or
20 // screen.RecoverOriginalOperation(); never replace the unresolved original.
21 // The sample refreshes Inventory, Values and Marketplace before acknowledgement.
22 // Its native file journal rejects WebGL writes; use a durable browser persister.
23}
Open the complete SDK sample ↗

Try with two players

Use two signed-in players in the same project. Configure the currency, fee and item price rule, then list one unequipped item and explicitly confirm its purchase.

Use the existing signed-in session. After an uncertain purchase, keep and retry the same original request, then refresh inventory and balances.

Cancellation keeps the original item protected until its owner claims it. Recovery is available only when the previous owner was deleted.

Listings and replay protection are stored once in the project. Players retain references and limited status data.

Test your new feature.

The buyer receives the same item and the seller receives the agreed price minus the configured fee.

Choose the same project in the dashboard as in your game configuration.

Endpoints
  • GET/marketplace/limits
  • GET/marketplace/rules
  • GET/marketplace
  • GET/marketplace/listings
  • GET/marketplace/listings/{listingId}
  • POST/marketplace/listings
  • POST/marketplace/listings/{listingId}/buy
  • POST/marketplace/listings/{listingId}/cancel
  • GET/marketplace/operations/{operationId}
  • POST/marketplace/listings/{listingId}/retry-return
All endpoints in the API reference
Our suggestion for your next step

Give every round a high score.

Save the score after a round and show who's ahead. Keep using your connection and player session.