Skip to content

Server-to-server API

The server-to-server (S2S) API is how your backend talks to LootBox Solutions. It mints sessions, reads the catalog, drives the gameplay lifecycle (purchase / cashout / cancel / history), and handles admin SSO.

All S2S endpoints are under https://{operator}.app.lootboxsolutions.com/api/s2s and are HMAC-signed with your inbound API key.

Endpoints

MethodPathPurpose
POST/launchesAuthenticate a player & mint a session
GET/boxesRead the box catalog
GET/boxes/{boxId}Read one box’s prize table (values, images, odds)
GET/boxes/{boxId}/versionResolve the live current version to open (no prize table)
POST/purchaseOpen a box (atomic) or pre-pay into the vault
POST/cashoutCash back a won inventory item
POST/cancelRefund an unopened (held) box
GET/historyList transactions (purchases, opens, refunds, cashbacks)
POST/admin-ssoMint an embedded-admin SSO link
GET/healthLiveness check

Conventions

  • Auth: every call carries X-Key-Id, X-Timestamp, X-Signature. See Authentication.
  • Money: integer minor units; currency accompanies every amount.
  • Time: ISO 8601 UTC.
  • Ids: boxes use integer ids; rounds, orders, and other resources use opaque public ids (r_…, fo_…) safe to expose to players.
  • Idempotency: write endpoints accept an idempotencyKey (or clientActionId) so retries are safe. Reusing a key returns the original result instead of acting twice.
  • Errors: a JSON body { "error": { "code": "…", "message": "…" } } with an appropriate HTTP status. The full list is in the error reference.

Relationship to the player API

Purchase, cashout, and cancel also exist on the bearer-authenticated player API that the game app drives. The S2S versions here are for backend-driven integrations (Model B): same effects, same wallet calls, signed with your API key instead of a session token, and acting on behalf of a playerExternalId you supply.