> ## Documentation Index
> Fetch the complete documentation index at: https://docs.d-sports.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Buy a playbook upgrade node

> Unknown nodeId returns 400 VALIDATION_ERROR. Already-owned nodes return 400 VALIDATION_ERROR (stale client state; never the already-played screen). Insufficient Playbooks returns 409 IDLE_INSUFFICIENT_BUZZ. Costs 1-3 Playbooks per the frozen node table. Idempotent per idempotencyKey. Optional X-Client-Version below minClientVersion returns 403 GAME_UPDATE_REQUIRED.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/engage/games/locker-singularity/ledger/upgrades
openapi: 3.1.0
info:
  title: D-Sports API
  description: >-
    Public API for the D-Sports fan engagement platform (PWA backend). Most
    endpoints require Clerk Bearer authentication.
  version: 1.0.0
servers:
  - url: https://app.d-sports.org
    description: Production
  - url: http://localhost:3004
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Authentication and token exchange
  - name: Logout
    description: Session logout
  - name: Mobile auth
    description: OAuth flow for native apps
  - name: Teams
    description: Teams list and follow/unfollow
  - name: Leaderboard
    description: Leaderboards, seasons, winners, stats
  - name: Locker room
    description: Social feed posts, comments, reactions
  - name: Packs
    description: Packs list, purchase, open
  - name: User
    description: Profile, onboarding, follow, search, privacy
  - name: Quests
    description: Quests and progress
  - name: Rewards
    description: Rewards claim and redeem
  - name: Wallets
    description: Wallets and coin prices
  - name: Checkout
    description: Crypto and D-Sports Cash checkout
  - name: D-Sports Cash
    description: D-Sports Cash balance
  - name: Dashboard
    description: Dashboard stats and balance
  - name: Products
    description: Products and packs catalog
  - name: Webhooks
    description: RevenueCat webhook
  - name: Misc
    description: Image proxy, crypto prices, upload, feedback
  - name: Auth and onboarding
    description: Domain grouping for auth, profile, onboarding, and identity flows
  - name: Social and locker room
    description: Domain grouping for social feed, follows, and community interactions
  - name: Gamification
    description: >-
      Domain grouping for quests, leaderboards, points-facing outcomes, and
      rewards
  - name: Commerce and purchases
    description: >-
      Domain grouping for checkout, cash balance, webhooks, and store purchase
      flows
  - name: Collectibles and packs
    description: Domain grouping for pack lifecycle and collectible inventory
  - name: Wallet and web3
    description: Domain grouping for wallet and crypto-support operations
  - name: Moderation and reporting
    description: >-
      Domain grouping for user-facing report submission and moderation-adjacent
      endpoints
  - name: Platform and infrastructure
    description: >-
      Domain grouping for utility, infrastructure, and platform support
      endpoints
  - name: Rep
    description: Fan / Club / Player / Direct Rep earn, breakdown, and ledger
  - name: Engage
    description: Engage-domain Rep and related mobile contracts
  - name: Admin
    description: Staff-only admin operations
  - name: Binders
    description: Digital binder inventory, PIN, and card transfer
  - name: Games
    description: Team mini-game catalog and play routes
  - name: Game Engine
    description: Engage native catalog and server-authoritative daily session lifecycle
  - name: Events
    description: Game schedule, Game Center, chat, presence, and ratings
  - name: Notifications
    description: Authenticated in-app inbox
  - name: Config
    description: Public catalogs and support matrices
  - name: Discovery
    description: Suggested fans and teams
  - name: Leagues
    description: League metadata and branding
  - name: Marketplace
    description: Listings, bids, offers, cart, and shop merchandising
  - name: KYC
    description: Identity verification session helpers
paths:
  /api/v1/engage/games/locker-singularity/ledger/upgrades:
    post:
      tags:
        - Games
        - Game Engine
        - Engage
      summary: Buy a playbook upgrade node
      description: >-
        Unknown nodeId returns 400 VALIDATION_ERROR. Already-owned nodes return
        400 VALIDATION_ERROR (stale client state; never the already-played
        screen). Insufficient Playbooks returns 409 IDLE_INSUFFICIENT_BUZZ.
        Costs 1-3 Playbooks per the frozen node table. Idempotent per
        idempotencyKey. Optional X-Client-Version below minClientVersion returns
        403 GAME_UPDATE_REQUIRED.
      parameters:
        - name: X-Client-Version
          in: header
          required: false
          schema:
            type: string
          description: >-
            Native client semver. Below minClientVersion returns 403
            GAME_UPDATE_REQUIRED.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - nodeId
                - idempotencyKey
              properties:
                nodeId:
                  type: string
                  enum:
                    - locker-room-10
                    - packs-25
                    - hockey-dailies-10
                    - micd-up-25
                    - locker-room-global-5
                    - micd-up-global-5
                idempotencyKey:
                  type: string
                  format: uuid
              additionalProperties: false
      responses:
        '200':
          description: '{ ledger }'
          content:
            application/json:
              schema:
                type: object
                required:
                  - ledger
                properties:
                  ledger:
                    $ref: '#/components/schemas/LedgerState'
        '400':
          description: VALIDATION_ERROR
        '401':
          description: UNAUTHORIZED
        '403':
          description: GAME_UPDATE_REQUIRED
        '404':
          description: GAME_UNKNOWN
        '409':
          description: IDLE_INSUFFICIENT_BUZZ
      security:
        - bearerAuth: []
components:
  schemas:
    LedgerState:
      type: object
      description: >-
        locker-singularity idle ledger wire state. Buzz counters are BigInt
        serialized as decimal strings. Additive-only wire evolution
        (d-sports-api#682).
      required:
        - buzz
        - lifetimeBuzz
        - cumulativeBuzz
        - playbooks
        - generators
        - milestonesClaimed
        - upgrades
        - rings
        - totalRings
        - prestigeCount
        - multiplier
        - prestigeUnlocked
        - version
        - lastSeenAt
      properties:
        buzz:
          type: string
          description: BigInt serialized as decimal string.
        lifetimeBuzz:
          type: string
          description: BigInt serialized as decimal string.
        cumulativeBuzz:
          type: string
          description: BigInt serialized as decimal string.
        playbooks:
          type: integer
        generators:
          type: array
          items:
            $ref: '#/components/schemas/IdleLedgerGeneratorState'
        milestonesClaimed:
          type: array
          items:
            type: string
        upgrades:
          type: array
          items:
            type: string
        rings:
          type: integer
          description: >-
            Most recent prestige grant (informational); totalRings is the
            cumulative balance.
        totalRings:
          type: integer
        prestigeCount:
          type: integer
        multiplier:
          type: number
        prestigeUnlocked:
          type: boolean
        version:
          type: integer
        lastSeenAt:
          type: string
          format: date-time
    IdleLedgerGeneratorState:
      type: object
      required:
        - generatorId
        - owned
      properties:
        generatorId:
          type: string
          enum:
            - rookie-card
            - foam-finger-stand
            - zamboni-fleet
            - banner-press
        owned:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Clerk session token. Use Authorization: Bearer <token>.'

````