{
  "openapi": "3.1.0",
  "info": {
    "title": "PartnerTubes catalog & quote API",
    "version": "1.0.0",
    "description": "Search PartnerTubes's catalog of vacuum electronic devices and submit quote requests (RFQs). Quote requests are emailed to the sales team and answered by email, typically within one business day. Parts not in the catalog can still be requested.",
    "contact": {
      "email": "info@partnertubes.com",
      "url": "https://www.partnertubes.com/contact/"
    }
  },
  "servers": [
    {
      "url": "https://www.partnertubes.com"
    }
  ],
  "paths": {
    "/api/catalog": {
      "get": {
        "operationId": "searchCatalog",
        "summary": "Search parts by part number, type or keyword",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Part number or keywords, e.g. \"YJ1600\" or \"thyratron\""
          },
          {
            "name": "cat",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "magnetrons",
                "rf-power-grid-tubes",
                "vacuum-capacitors",
                "microwave-tubes",
                "laser-parts",
                "electronic-components"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 24
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching parts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sku": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "subcategory": {
                            "type": "string"
                          },
                          "manufacturer": {
                            "type": "string"
                          },
                          "short_desc": {
                            "type": "string"
                          },
                          "specs": {
                            "type": "string",
                            "description": "JSON object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/contact": {
      "post": {
        "operationId": "requestQuote",
        "summary": "Submit a quote request (RFQ) on behalf of a buyer",
        "description": "Only submit with the buyer's consent and their real contact details. One request may list several part numbers (one per line).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "part_numbers"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "company": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "part_numbers": {
                    "type": "string",
                    "description": "Part number(s) or description, one per line"
                  },
                  "quantity": {
                    "type": "string"
                  },
                  "needed_by": {
                    "type": "string"
                  },
                  "product_category": {
                    "type": "string",
                    "enum": [
                      "magnetrons",
                      "rf-power-grid-tubes",
                      "vacuum-capacitors",
                      "microwave-tubes",
                      "laser-parts",
                      "electronic-components"
                    ]
                  },
                  "enquiry_type": {
                    "type": "string",
                    "enum": [
                      "quote",
                      "availability",
                      "technical",
                      "cross-reference",
                      "rma",
                      "other"
                    ],
                    "default": "quote"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\": true}"
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    }
  }
}