{
  "openapi": "3.1.0",
  "info": {
    "title": "Subs links",
    "version": "1.0.0",
    "description": "Subs has no API that reads or changes anyone's subscriptions: they are private. The one thing an assistant can do is send a link that opens Subs with a subscription filled in. The person checks it and taps Add subscription. Nothing is saved until they do."
  },
  "servers": [
    {
      "url": "https://subs-free.openapps.xyz"
    }
  ],
  "paths": {
    "/add": {
      "get": {
        "operationId": "openAddPageFilledIn",
        "summary": "Open the Add page with a subscription filled in",
        "description": "Returns the Subs web page, not data. Give the link to the person. Nothing is saved until they tap Add subscription.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "What the subscription is called, like Netflix."
          },
          {
            "name": "price",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "19.99"
              ]
            },
            "description": "What one charge costs, in the person's own currency. If left out, the person types it."
          },
          {
            "name": "cycle",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "daily",
                "weekly",
                "monthly",
                "yearly"
              ],
              "default": "monthly"
            }
          },
          {
            "name": "every",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "default": 1
            },
            "description": "Number of cycles between charges. cycle=monthly&every=3 is every 3 months."
          },
          {
            "name": "next",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The next renewal date. For a free trial, the day it ends."
          },
          {
            "name": "trial",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "1 when it is a free trial."
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "video",
                "music",
                "software",
                "storage",
                "news",
                "games",
                "health",
                "learning",
                "food",
                "shopping",
                "money",
                "work",
                "family",
                "home",
                "other"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Subs page, ready for the person to check and save.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
