openapi: 3.0.3
info:
  title: Luban Play OpenAPI
  version: 1.3.1
  description: B2B catalog, wallet, gift card, game top-up and enterprise bulk-order API for approved partners.
servers:
  - url: https://api.lubanplay.com
security:
  - bearerAuth: []
paths:
  /index.php?s=/api/openapi/balance:
    post:
      summary: Get wallet balances
      responses: {'200': {description: Wallet balances returned}}
  /index.php?s=/api/openapi/products:
    post:
      summary: List enabled gift card products
      responses: {'200': {description: Product list returned}}
  /index.php?s=/api/openapi/createOrder:
    post:
      summary: Create a gift card order
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [product_id, client_reference]
              properties:
                product_id: {type: string}
                amount: {type: number, description: Required for open-value products}
                quantity: {type: integer, default: 1, maximum: 50}
                client_reference: {type: string, description: Unique idempotency reference}
      responses: {'200': {description: Order accepted or delivered}, '409': {description: Idempotency conflict}}
  /index.php?s=/api/openapi/queryOrder:
    post:
      summary: Query a gift card order
      responses: {'200': {description: Order status returned}, '404': {description: Order not found}}
  /index.php?s=/api/openapi/createBulkOrder:
    post:
      summary: Create an enterprise bulk order
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [product_id, quantity, client_reference]
              properties:
                product_id: {type: string}
                amount: {type: number, description: Required for open-value products}
                quantity: {type: integer, maximum: 1000}
                client_reference: {type: string}
      responses: {'202': {description: Batch accepted; batch_id returned}}
  /index.php?s=/api/openapi/queryBulkOrder:
    get:
      summary: Query bulk order progress
      parameters:
        - in: query
          name: batch_id
          required: true
          schema: {type: string}
      responses: {'200': {description: Batch progress returned}}
  /index.php?s=/api/openapi/downloadBulkOrderCsv:
    get:
      summary: Download delivered bulk-order codes as CSV
      parameters:
        - in: query
          name: batch_id
          required: true
          schema: {type: string}
      responses: {'200': {description: CSV file}}
  /index.php?s=/api/openapi/topupProducts:
    post:
      summary: List enabled top-up games
      responses: {'200': {description: Game list returned}}
  /index.php?s=/api/openapi/topupPackages:
    post:
      summary: List top-up packages
      responses: {'200': {description: Package list returned}}
  /index.php?s=/api/openapi/createTopupOrder:
    post:
      summary: Create a game top-up order
      responses: {'200': {description: Top-up order accepted}}
  /index.php?s=/api/openapi/queryTopupOrder:
    post:
      summary: Query a game top-up order
      responses: {'200': {description: Top-up order status returned}}
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
