{
  "openapi": "3.1.0",
  "security": [
    {}
  ],
  "info": {
    "title": "AssOutArmory Agent Catalog",
    "version": "1.0.0",
    "summary": "Read-only product catalog for AI agents.",
    "description": "Comedy printables and novelty desk toys. Agents never pay: give the human the checkout_url. Jokes only; no firearms, ammo, or regulated parts.",
    "contact": {
      "name": "AssOutArmory",
      "url": "https://assoutarmory.com"
    },
    "license": {
      "name": "Free to read for shopping assistance",
      "url": "https://assoutarmory.com"
    }
  },
  "servers": [
    {
      "url": "https://agents.everybodyhasagun.com",
      "description": "Primary"
    },
    {
      "url": "https://assoutarmory-agents.disruptionup.workers.dev",
      "description": "workers.dev mirror"
    }
  ],
  "paths": {
    "/products.json": {
      "get": {
        "operationId": "listProducts",
        "summary": "Full catalog",
        "parameters": [
          {
            "name": "recipient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DIYer",
                "coworker",
                "dad",
                "host",
                "mom",
                "nurse",
                "parent",
                "shooter-friend",
                "stocking-stuffer",
                "white-elephant"
              ]
            },
            "description": "Only products tagged for this recipient."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "physical",
                "digital"
              ]
            }
          },
          {
            "name": "max_price",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0
            },
            "description": "Maximum price in USD. Excludes coming-soon items without a price."
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed (read-only API; GET only)"
          }
        }
      }
    },
    "/gifts.json": {
      "get": {
        "operationId": "listGifts",
        "summary": "Gift ideas tagged by recipient",
        "parameters": [
          {
            "name": "recipient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DIYer",
                "coworker",
                "dad",
                "host",
                "mom",
                "nurse",
                "parent",
                "shooter-friend",
                "stocking-stuffer",
                "white-elephant"
              ]
            },
            "description": "Only products tagged for this recipient."
          }
        ],
        "responses": {
          "200": {
            "description": "Gift ideas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GiftList"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed (read-only API; GET only)"
          }
        }
      }
    },
    "/products/{id}": {
      "get": {
        "operationId": "getProduct",
        "summary": "One product by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "patient-side-wedges",
                "return-my-container-labels",
                "gift-wrap-code-labels",
                "funny-range-signs",
                "christmas-elf-report-pack",
                "pre-stripped-screws"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "404": {
            "description": "Unknown id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/stats.json": {
      "get": {
        "operationId": "getStats",
        "summary": "Aggregate request counts (no IPs)",
        "responses": {
          "200": {
            "description": "Counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed (read-only API; GET only)"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "Product": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "price",
          "currency",
          "type",
          "status",
          "checkout"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "type": {
            "type": "string",
            "enum": [
              "physical",
              "digital"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "coming_soon"
            ]
          },
          "shipping": {
            "type": "object",
            "additionalProperties": true
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "why_its_funny": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "checkout_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "checkout_url_tracked": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "alternate_checkout_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Alternate human checkout (PayPal Business payment link). Only present on products that have one."
          },
          "alternate_checkout_url_tracked": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Redirect that logs PayPal handoffs separately: /go/{id}?via=paypal"
          },
          "checkout_options": {
            "type": "array",
            "description": "All human checkout options. Etsy is primary.",
            "items": {
              "$ref": "#/components/schemas/CheckoutOption"
            }
          },
          "checkout": {
            "$ref": "#/components/schemas/Checkout"
          },
          "promo": {
            "type": "null",
            "description": "No active promo code."
          }
        }
      },
      "Checkout": {
        "type": "object",
        "required": [
          "method",
          "agent_may_pay",
          "instructions"
        ],
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "human_approval_required",
              "unavailable"
            ]
          },
          "agent_may_pay": {
            "type": "boolean",
            "const": false
          },
          "instructions": {
            "type": "string"
          }
        }
      },
      "CheckoutOption": {
        "type": "object",
        "required": [
          "provider",
          "url",
          "primary"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "etsy",
              "paypal"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "tracked_url": {
            "type": "string",
            "format": "uri"
          },
          "primary": {
            "type": "boolean"
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "shipping": {
            "type": "string"
          },
          "max_per_order": {
            "type": [
              "integer",
              "null"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ProductList": {
        "type": "object",
        "required": [
          "products",
          "count"
        ],
        "properties": {
          "shop": {
            "type": "object",
            "additionalProperties": true
          },
          "version": {
            "type": "string"
          },
          "checkout_rule": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          }
        }
      },
      "GiftList": {
        "type": "object",
        "required": [
          "gifts",
          "by_recipient"
        ],
        "properties": {
          "shop": {
            "type": "object",
            "additionalProperties": true
          },
          "version": {
            "type": "string"
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "filter": {
            "type": [
              "string",
              "null"
            ]
          },
          "checkout_rule": {
            "type": "string"
          },
          "gifts": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "by_recipient": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    }
  }
}
