xGameFi

Studio setup guide

Get started

Create your studio account at /register. Registration creates your studio, owner account, and default shop in one step. Once registered, you are dropped into the dashboard at /dashboard.

1. Connect your game

Open /dashboard/settings and fill in the integration details:

  • Payout wallet — the Stellar public key that receives net sale proceeds.
  • Webhook URL + secret — where xGameFi posts signed purchase.completed events so your game can grant items.
  • API key — issue a key for authenticated item ingest.
  • Integration mode — choose PULL (xGameFi fetches your item API periodically) or PUSH (you send items to xGameFi).

2. Sync your catalogue

For PULL mode, set your apiBaseUrl in settings and run a catalogue sync from /dashboard/items.

For PUSH mode, send items to xGameFi:

POST /api/v1/ingest/items
Content-Type: application/json
X-Api-Key: your_api_key

{
  "items": [
    {
      "externalId": "sword-skin-001",
      "name": "Neon Sword Skin",
      "description": "A glowing sword skin.",
      "price": "1.00",
      "currency": "USDT",
      "stock": 100,
      "category": "skins",
      "rarity": "legendary",
      "imageUrl": "https://your-cdn.com/sword.png"
    }
  ]
}

3. Configure items

In /dashboard/items you can edit each item’s price, currency, stock, category, rarity, and sale window. Toggle Listed to show or hide an item from your storefront.

4. Build and publish the storefront

Open /dashboard/builder. Arrange items, pick grid or list layout, set featured items, and apply your brand colors. Save drafts as often as you like, then click Publish to go live at /s/[your-studio-slug].

5. Test a purchase

Visit your live shop, connect a Stellar wallet (Freighter), and complete a checkout. Verify that:

  • The order appears in your dashboard transactions.
  • The payment settles on-chain.
  • Your webhook receives a signed event and grants the item.
  • The net payout lands in your studio wallet.

Webhook payload example

Each successful purchase sends a signed purchase.completed event to your webhook URL:

POST https://your-game.com/webhook
X-xGameFi-Signature: t=1690000000,v1=<hex_signature>

{
  "event": "purchase.completed",
  "orderId": "ord_...",
  "externalItemId": "sword-skin-001",
  "playerId": "player-wallet-address",
  "quantity": 1,
  "amount": "0.95",
  "currency": "USDT"
}

Verify the signature with HMAC-SHA256 using your webhook secret:

const expected = crypto
  .createHmac("sha256", webhookSecret)
  .update(`${timestamp}.${body}`)
  .digest("hex");

if (!crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
  throw new Error("Invalid signature");
}

6. Grow with promotions and referrals

Once orders are flowing, set up:

  • Promotions — percent, fixed, bundle, or first-purchase discounts.
  • Referrals — reward players who invite others.