{
  "openapi": "3.1.0",
  "info": {
    "title": "SimpleSMS API",
    "version": "1.0.0",
    "description": "SimpleSMS customer API for balance, prices, orders and order cancellation."
  },
  "servers": [
    {
      "url": "https://fenjueauto.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/balance": {
      "get": {
        "summary": "Query wallet balance",
        "responses": {
          "200": {
            "description": "Balance returned"
          }
        }
      }
    },
    "/v1/catalog/prices": {
      "get": {
        "summary": "List SMS prices",
        "responses": {
          "200": {
            "description": "Price catalog returned"
          }
        }
      }
    },
    "/v1/catalog/email-prices": {
      "get": {
        "summary": "List email prices",
        "responses": {
          "200": {
            "description": "Email price catalog returned"
          }
        }
      }
    },
    "/v1/orders": {
      "post": {
        "summary": "Create verification order",
        "responses": {
          "200": {
            "description": "Order created"
          }
        }
      }
    },
    "/v1/orders/{orderId}": {
      "get": {
        "summary": "Get order",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order returned"
          }
        }
      }
    },
    "/v1/orders/{orderId}/cancel": {
      "post": {
        "summary": "Cancel order",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order cancellation result"
          }
        }
      }
    },
    "/v1/orders/{orderId}/ready": {
      "post": {
        "summary": "Mark SMS order ready for code",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ready signal accepted"
          }
        }
      }
    },
    "/v1/webhook": {
      "get": {
        "summary": "Get client webhook configuration",
        "responses": {
          "200": {
            "description": "Webhook configuration returned"
          }
        }
      },
      "put": {
        "summary": "Set client webhook configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": { "type": "string" },
                  "secret": { "type": "string" },
                  "enabled": { "type": "boolean" }
                },
                "required": ["url"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook configuration saved"
          }
        }
      }
    }
  }
}
