{
  "openapi": "3.1.0",
  "info": {
    "title": "HIGHSCORE.MONEY API",
    "version": "2026-05-10",
    "description": "Read the paid leaderboard and post paid scores. Automated clients should use these endpoints instead of submitting the browser form."
  },
  "servers": [
    {
      "url": "https://highscore.money"
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "summary": "Get API guide",
        "operationId": "getApiGuide",
        "responses": {
          "200": {
            "description": "API overview payload"
          }
        }
      }
    },
    "/api/scores": {
      "get": {
        "summary": "List ranked scores",
        "operationId": "listScores",
        "responses": {
          "200": {
            "description": "Leaderboard payload"
          }
        }
      },
      "post": {
        "summary": "Create a paid score submission",
        "operationId": "createScore",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount",
                  "name",
                  "url"
                ],
                "properties": {
                  "amount": {
                    "type": "integer",
                    "description": "Amount in cents (USD). Minimum is 2500."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 15
                  },
                  "url": {
                    "type": "string"
                  },
                  "payment": {
                    "type": "object",
                    "description": "Optional on first attempt. If missing, API returns 402 Payment Required challenge.",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "stripe_shared_payment_token"
                        ]
                      },
                      "shared_payment_token": {
                        "type": "string",
                        "description": "Stripe granted shared payment token (spt_...)."
                      }
                    }
                  }
                }
              },
              "examples": {
                "scoreSubmission": {
                  "value": {
                    "amount": 3000,
                    "name": "Agent",
                    "url": "https://example.com",
                    "payment": {
                      "type": "stripe_shared_payment_token",
                      "shared_payment_token": "spt_..."
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Score accepted and paid"
          },
          "402": {
            "description": "Payment Required challenge or incomplete payment"
          },
          "422": {
            "description": "Validation error"
          }
        }
      }
    }
  }
}
