{
  "openapi": "3.1.0",
  "info": {
    "title": "com.paratus-ai.supplier（事業者条件表）",
    "version": "0.1.0-draft",
    "description": "事業者条件表の REST API。ドラフトで、今後の版で変わることがあります。エラーの message は日本語の要約、validation_error の details.message は入力検証（zod）の英語の原文です。details.path に誤りのある項目・パラメータ名が入ります。"
  },
  "x-status": "draft",
  "paths": {
    "/v1/organizations/{id}": {
      "get": {
        "summary": "事業者の基本情報",
        "description": "事業者名・法人番号・対応言語・支払方法・資格・業法上の表示・拠点を返す。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "事業者の基本情報",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://paratus-ai.com/spec/supplier/0.1/profile.schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{id}/offerings": {
      "get": {
        "summary": "提供物と価格",
        "description": "公開中の提供物・価格・納期・業種別の項目を返す。登録していない AI には価格の上下限（price.min・max）と条件付き価格（pricing_rules）を返さず、丸めた価格帯（price.band）だけを返す。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "提供物と価格",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://paratus-ai.com/spec/supplier/0.1/offerings.schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes": {
      "post": {
        "summary": "見積依頼",
        "description": "見積を依頼し、案件を作る。事業者の回答はメール、または案件の状態（GET /v1/cases/{id}）で返す。発注の確定（confirm-order）の委任状（mandate）は省略でき、省略したとき・検証できないとき・登録済みの来訪AIのときは 202 human_confirmation_required と確認リンク（confirmation_url）を返す。検収の確認（confirm-completion）は、発注の記録があり、事業者が完了を記録した案件だけで受け付ける（それ以外は validation_error。reason は order_required・completion_not_reported）。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://paratus-ai.com/spec/supplier/0.1/quote.schema.json#/$defs/request"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "見積依頼",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://paratus-ai.com/spec/supplier/0.1/quote.schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{id}/availability": {
      "get": {
        "summary": "受付可能日と予約先",
        "description": "最短の着手日、外部の予約先、拠点ごとの対応可否、予約できる担当者・設備、体験の申込条件を返す。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "受付可能日と予約先",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://paratus-ai.com/spec/supplier/0.1/availability.schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{id}/cancellation-terms": {
      "get": {
        "summary": "解約・切替条件",
        "description": "公開中の解約・切替の条件（通知日数・返金・手数料・クーリングオフ・手続き）を返す。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "解約・切替条件",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://paratus-ai.com/spec/supplier/0.1/cancellation.schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{id}/track-record": {
      "get": {
        "summary": "実績",
        "description": "公開中の指標（直近12か月）と応答の状況を返す。母数が少ない指標は値を返さず status=accumulating とする。買い手の確認を経た記録と事業者申告は basis で区別する。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "実績",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://paratus-ai.com/spec/supplier/0.1/track_record.schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cases/{id}": {
      "get": {
        "summary": "案件の状態",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "案件の状態",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://paratus-ai.com/spec/supplier/0.1/quote.schema.json#/$defs/case_status"
                }
              }
            }
          }
        }
      }
    },
    "/v1/listings": {
      "get": {
        "summary": "横断検索",
        "description": "公開情報を条件で横断検索する（MCP の search_listings）。知らないパラメータ、範囲外の limit・page は 400 validation_error（details.path にパラメータ名）。次のページは has_more が true のとき page を増やして取得する。",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "全文検索の語（200文字以内）",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "industry",
            "in": "query",
            "description": "業種コード",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "分類コード",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "lat",
            "in": "query",
            "description": "緯度。lng と両方指定すると、対応エリアで絞り込み近い順に並べる",
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            }
          },
          {
            "name": "lng",
            "in": "query",
            "description": "経度。lat と両方指定する",
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          {
            "name": "area_code",
            "in": "query",
            "description": "市区町村コード（5桁）。対応エリアで絞り込む",
            "schema": {
              "type": "string",
              "pattern": "^\\d{5}$"
            }
          },
          {
            "name": "price_max",
            "in": "query",
            "description": "価格の上限（最低価格がこれ以下）",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "accepting",
            "in": "query",
            "description": "受付中かどうか",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "1ページの件数（1〜20）",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 20
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "ページ番号（1〜100）",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "横断検索の結果",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "listings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "索引の行の ID"
                          },
                          "organization_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "location_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uuid"
                          },
                          "offering_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uuid"
                          },
                          "industry": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "業種コード"
                          },
                          "category": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "分類コード"
                          },
                          "org_name": {
                            "type": "string",
                            "description": "事業者名"
                          },
                          "offering_name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "提供物の名前"
                          },
                          "geo": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "lat": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "lng": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "lat",
                              "lng"
                            ],
                            "additionalProperties": false
                          },
                          "service_area": {
                            "type": "object",
                            "properties": {
                              "coverage_type": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "codes": {
                                "description": "対応エリアの市区町村コード"
                              }
                            },
                            "required": [
                              "coverage_type",
                              "codes"
                            ],
                            "additionalProperties": false
                          },
                          "price": {
                            "type": "object",
                            "properties": {
                              "band": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "価格帯"
                              },
                              "min": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "最低価格（登録済みの来訪AIのみ）"
                              },
                              "max": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "最高価格（登録済みの来訪AIのみ）"
                              },
                              "currency": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "tax_included": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "unit_label": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "band",
                              "currency",
                              "tax_included",
                              "unit_label"
                            ],
                            "additionalProperties": false
                          },
                          "lead_time_days_min": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lead_time_unit": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "calendar",
                              "business",
                              null
                            ],
                            "description": "納期の日数の単位（calendar 暦日・business 営業日）"
                          },
                          "earliest_start_date": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date"
                          },
                          "same_day_available": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "accepting": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "payment_methods": {
                            "description": "支払方法"
                          },
                          "invoice_payment_allowed": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "booking_url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "attributes": {
                            "description": "確認済みの属性"
                          },
                          "credentials": {
                            "description": "公開中の資格"
                          },
                          "metrics": {
                            "description": "公開中の指標"
                          },
                          "external_records": {
                            "description": "外部の実績・評価"
                          },
                          "conditions_published_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "responsiveness": {
                            "type": "object",
                            "properties": {
                              "last_response_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "date-time"
                              },
                              "via_platform_rate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "last_response_at",
                              "via_platform_rate"
                            ],
                            "additionalProperties": false
                          },
                          "locale": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [],
                        "additionalProperties": false
                      }
                    },
                    "page": {
                      "type": "integer",
                      "description": "ページ番号"
                    },
                    "limit": {
                      "type": "integer",
                      "description": "1ページの件数"
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "次のページがあるか（page を1つ増やして取得する）"
                    }
                  },
                  "required": [
                    "listings",
                    "page",
                    "limit",
                    "has_more"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "パラメータの誤り（validation_error）"
          }
        }
      }
    }
  }
}