> ## Documentation Index
> Fetch the complete documentation index at: https://developer.leaderos.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Store tree for a player

> Active categories (nested in `subcategories`) with their products, final prices, discounts and upgrade info. Categories the player cannot see (category required products) are hidden.



## OpenAPI

````yaml /plugin-api/openapi.yaml get /store/listing
openapi: 3.1.0
info:
  title: LeaderOS Plugin API
  version: 1.0.0
  description: >
    Server-to-server API of a LeaderOS website, used by the LeaderOS plugins
    (Minecraft, Hytale, FiveM, Rust…),

    Discord bots and your own backend integrations.


    - Every request needs the `X-Api-Key` header (Dashboard → Settings → API).
    The key is **secret**: never use it in browser or client code.

    - Request bodies are **form encoded** (`application/x-www-form-urlencoded`
    or `multipart/form-data`). JSON bodies are not validated.

    - Success: `{ "status": true, "data"?: … }`. Error: `{ "status": false,
    "error": "CODE", "message"?: "…" }`.
      Some read endpoints return the raw object or array without the envelope.
servers:
  - url: '{siteUrl}/api'
    description: Your LeaderOS website
    variables:
      siteUrl:
        default: https://your-site.com
        description: Your LeaderOS website URL (no trailing slash)
security:
  - apiKey: []
tags:
  - name: Auth
    description: In-game login, registration and sessions.
  - name: Store
    description: Products, categories, buying with credits, donations and community goal.
  - name: Credits
    description: Read and change a user's credit balance.
  - name: Users
    description: Users, their orders, tickets and roles.
  - name: Bazaar
    description: Player bazaar storage (items sent from the game).
  - name: Support
    description: Support tickets, messages, categories and canned answers.
  - name: Vote
    description: Voting links.
  - name: Discord
    description: Data used by the LeaderOS Discord bot.
  - name: Integrations
    description: LeaderOS ID and LeaderOS AI.
  - name: Command logs
    description: Command delivery queue used by LeaderOS Connect plugins.
paths:
  /store/listing:
    get:
      tags:
        - Store
      summary: Store tree for a player
      description: >-
        Active categories (nested in `subcategories`) with their products, final
        prices, discounts and upgrade info. Categories the player cannot see
        (category required products) are hidden.
      operationId: storeListing
      parameters:
        - name: username
          in: query
          required: false
          schema:
            type: string
          description: Calculates subscription upgrades and visibility for this player
      responses:
        '200':
          description: Category tree
          content:
            application/json:
              schema:
                type: object
                properties:
                  categories:
                    type: array
                    items:
                      $ref: '#/components/schemas/ListingCategory'
components:
  schemas:
    ListingCategory:
      allOf:
        - $ref: '#/components/schemas/Category'
        - type: object
          properties:
            subcategories:
              type: array
              items:
                $ref: '#/components/schemas/ListingCategory'
            products:
              type: array
              items:
                $ref: '#/components/schemas/ListingProduct'
    Category:
      type: object
      description: Raw ProductCategories row.
      properties:
        id:
          type: integer
        parentID:
          type: integer
        name:
          type: string
        slug:
          type: string
        isCumulative:
          type: string
        isActive:
          type: string
        priority:
          type: integer
    ListingProduct:
      allOf:
        - $ref: '#/components/schemas/Product'
        - type: object
          properties:
            discounted:
              type: boolean
            discountPercent:
              type: number
            upgradable:
              type: boolean
              description: Upgrade from the player's current subscription
            restricted:
              type: boolean
              description: Lower or equal tier than the current subscription
            subtotal:
              type: number
            tax:
              type: number
            discount:
              type: number
            total:
              type: number
              description: Final price including tax
            originalPrice:
              type: number
            originalPriceFormatted:
              type: string
            totalFormatted:
              type: string
            image:
              type: string
              description: Path on the website
    Product:
      type: object
      description: Raw Products row.
      properties:
        id:
          type: integer
        categoryID:
          type: integer
        name:
          type: string
        price:
          type: number
        discountedPrice:
          type: number
        discountExpiryDate:
          type: string
        stock:
          type: integer
          description: '-1 = unlimited'
        duration:
          type: integer
          description: Days, 0 = permanent
        priority:
          type: integer
        isActive:
          type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Secret API key from Dashboard → Settings → API. Server-side use only.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.