{
  "openapi": "3.1.0",
  "info": {
    "title": "Armful bunches API",
    "version": "1.0.0",
    "description": "How many wholesale bunches of one flower to order for a number of arrangements, with spare stems, leftovers, and cost. The same arithmetic as the Armful app (floral recipe software for wedding and event florists). Free, no key, read-only."
  },
  "servers": [
    {
      "url": "https://armful.party"
    }
  ],
  "paths": {
    "/api/bunches": {
      "get": {
        "operationId": "bunchesToOrder",
        "summary": "Bunches to order for one flower",
        "parameters": [
          {
            "name": "arrangements",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            },
            "description": "How many arrangements use this flower"
          },
          {
            "name": "stems_each",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            },
            "description": "Stems of this flower in each arrangement"
          },
          {
            "name": "stems_per_bunch",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            },
            "description": "Stems in one bunch from the wholesaler, for example 10 or 25"
          },
          {
            "name": "spare_percent",
            "in": "query",
            "schema": {
              "type": "number",
              "default": 10
            },
            "description": "Extra stems for breakage, percent"
          },
          {
            "name": "bunch_price",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Price of one bunch in dollars"
          }
        ],
        "responses": {
          "200": {
            "description": "The order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stems_needed": {
                      "type": "integer"
                    },
                    "stems_with_spare": {
                      "type": "integer"
                    },
                    "bunches": {
                      "type": "integer"
                    },
                    "stems_left_over": {
                      "type": "integer"
                    },
                    "cost": {
                      "type": "number"
                    },
                    "explanation": {
                      "type": "string"
                    },
                    "made_by": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}