{
  "openapi": "3.1.0",
  "info": {
    "title": "Hands & Craft Agent API",
    "version": "1.1.0",
    "description": "The first Indian manufacturing workshop with a public agent-callable interface. Query catalog, capacity, compliance. Request samples, quotes, and trade access programmatically. No API key required. Rate limit: 10 action requests per IP per hour.",
    "contact": {
      "name": "Hands & Craft",
      "email": "info@handsandcrafts.com",
      "url": "https://handsandcrafts.com/agents.html"
    }
  },
  "servers": [
    {
      "url": "https://handsandcrafts.com/api",
      "description": "Production"
    }
  ],
  "paths": {
    "/search_skus": {
      "post": {
        "summary": "Search the product catalog",
        "operationId": "search_skus",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "material": {
                    "type": "string"
                  },
                  "technique": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "subcategory": {
                    "type": "string"
                  },
                  "moq_max": {
                    "type": "integer"
                  },
                  "moq_min": {
                    "type": "integer"
                  },
                  "food_contact_safe": {
                    "type": "boolean"
                  },
                  "query": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching SKUs"
          }
        }
      }
    },
    "/get_sku": {
      "post": {
        "summary": "Get full SKU details",
        "operationId": "get_sku",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sku_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "sku_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SKU record"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/get_capabilities": {
      "post": {
        "summary": "List manufacturing capabilities",
        "operationId": "get_capabilities",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Capabilities"
          }
        }
      }
    },
    "/get_compliance_docs": {
      "post": {
        "summary": "Retrieve compliance summary",
        "operationId": "get_compliance_docs",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cert_type": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Compliance summary"
          }
        }
      }
    },
    "/check_capacity": {
      "post": {
        "summary": "Check production capacity",
        "operationId": "check_capacity",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "units": {
                    "type": "integer"
                  },
                  "category": {
                    "type": "string"
                  }
                },
                "required": [
                  "start_date",
                  "units"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Capacity status"
          }
        }
      }
    },
    "/request_access": {
      "post": {
        "summary": "Request trade access (buyer onboarding + unlock token)",
        "operationId": "request_access",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fields": {
                    "type": "object",
                    "required": [
                      "name",
                      "company",
                      "email"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "company": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "role": {
                        "type": "string"
                      },
                      "sourcing_for": {
                        "type": "string"
                      },
                      "order_size": {
                        "type": "string"
                      },
                      "region": {
                        "type": "string"
                      },
                      "website": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "fields"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Granted with unlock token"
          },
          "400": {
            "description": "Validation error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/request_sample": {
      "post": {
        "summary": "Initiate a sample request",
        "operationId": "request_sample",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sku_id": {
                    "type": "string"
                  },
                  "ship_to_country": {
                    "type": "string"
                  },
                  "ship_to_address": {
                    "type": "string"
                  },
                  "buyer_name": {
                    "type": "string"
                  },
                  "buyer_company": {
                    "type": "string"
                  },
                  "buyer_email": {
                    "type": "string",
                    "format": "email"
                  },
                  "buyer_whatsapp": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "sku_id",
                  "ship_to_country",
                  "buyer_name",
                  "buyer_company",
                  "buyer_email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sample request logged, team notified"
          }
        }
      }
    },
    "/get_quote": {
      "post": {
        "summary": "Request a formal quote",
        "operationId": "get_quote",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sku_id": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "integer"
                  },
                  "customization": {
                    "type": "object"
                  },
                  "ship_to_country": {
                    "type": "string"
                  },
                  "buyer_info": {
                    "type": "object"
                  }
                },
                "required": [
                  "sku_id",
                  "quantity"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rough estimate + formal quote pending"
          }
        }
      }
    },
    "/schedule_call": {
      "post": {
        "summary": "Request a call with our team",
        "operationId": "schedule_call",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "buyer_info": {
                    "type": "object"
                  },
                  "preferred_time": {
                    "type": "string"
                  },
                  "topic": {
                    "type": "string"
                  },
                  "meeting_type": {
                    "type": "string",
                    "enum": [
                      "video",
                      "voice"
                    ]
                  }
                },
                "required": [
                  "buyer_info"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Call request logged"
          }
        }
      }
    },
    "/contact": {
      "post": {
        "summary": "General contact form",
        "operationId": "contact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fields": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "company": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "project_description": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "email"
                    ]
                  }
                },
                "required": [
                  "fields"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Logged"
          }
        }
      }
    }
  }
}