> ## Documentation Index
> Fetch the complete documentation index at: https://docs.legitmark.com/llms.txt
> Use this file to discover all available pages before exploring further.

# タクソノミー

> 正確な認証要件のためのアイテム分類システム。

## 概要

Legitmark は4レベルの階層分類システムを使用しています。各レベルが認証要件とサービス選択を決定します：

```mermaid theme={null}
graph TD
    A["カテゴリ<br/><small>トップレベル分類</small>"] --> B1["バッグ"]
    A --> B2["時計"]
    
    B1 --> C1["トートバッグ"]
    B1 --> C2["クラッチバッグ"]
    B2 --> C3["高級時計"]
    B2 --> C4["スポーツウォッチ"]
    
    C1 --> D1["ルイ・ヴィトン"]
    C1 --> D2["シャネル"]
    C3 --> D3["ロレックス"]
    C3 --> D4["ルイ・ヴィトン"]
    
    D1 --> E1["ネヴァーフル MM"]
    D1 --> E2["スピーディ 30"]
    D3 --> E3["サブマリーナ"]
    D4 --> E4["タンブール"]
    
    style A fill:#e1f5fe
    style B1 fill:#f3e5f5
    style B2 fill:#f3e5f5
    style C1 fill:#fff3e0
    style C2 fill:#fff3e0
    style C3 fill:#fff3e0
    style C4 fill:#fff3e0
    style D1 fill:#e8f5e8
    style D2 fill:#e8f5e8
    style D3 fill:#e8f5e8
    style D4 fill:#e8f5e8
    style E1 fill:#fce4ec
    style E2 fill:#fce4ec
    style E3 fill:#fce4ec
    style E4 fill:#fce4ec
```

**階層レベル：**

* **レベル 1：カテゴリ**（必須）- 広範な製品分類
* **レベル 2：タイプ**（必須）- 具体的な製品サブカテゴリ
* **レベル 3：ブランド**（オプション）- メーカーまたはデザイナー
* **レベル 4：モデル**（オプション）- 具体的な製品バリアント

## タクソノミーデータの取得

### 完全なツリー

初期セットアップ用に1回のリクエストですべてを取得：

**API リファレンス：** [タクソノミーツリーを取得](/api-reference/categories/get-taxonomy-tree) - `GET /api/v2/categories/tree`

<CodeGroup>
  ```javascript HTTP theme={null}
  const response = await fetch('https://api.legitmark.com/api/v2/categories/tree?active_only=true', {
    headers: { 'Authorization': 'Bearer leo_xxxxxxxxx' }
  });
  const { data: categories, metadata } = await response.json();
  ```

  ```typescript SDK theme={null}
  const { data: categories, metadata } = await legitmark.taxonomy.getTree({ activeOnly: true });

  console.log(`${metadata.total_categories} categories, ${metadata.total_types} types`);
  for (const category of categories) {
    console.log(`${category.name}: ${category.types?.length} types`);
  }
  ```
</CodeGroup>

<Tip>
  タクソノミーツリーにはカテゴリとタイプ（必須）、およびブランドとモデル（オプション）が含まれます。**完全なタクソノミー深度に基づいてより具体的な画像要件を取得するために、ブランドとモデルのマッチングを強く推奨します**。ブランドとモデルがマッチしない場合、認証に追加の写真が必要になる場合があります。
</Tip>

### 主要なフィルタリングエンドポイント

* [タイプのブランドを取得](/api-reference/types/get-brands-for-type)
* [ブランドのモデルを取得](/api-reference/brands/get-models-for-brand)

### その他のエンドポイント

* [ブランド一覧](/api-reference/brands/list-brands)
* [カテゴリのタイプを取得](/api-reference/categories/get-types-for-category)
* [カテゴリ一覧](/api-reference/categories/list-categories)
* [単一カテゴリを取得](/api-reference/categories/get-single-category)
* [タイプ一覧](/api-reference/types/list-types)
* [単一タイプを取得](/api-reference/types/get-single-type)
* [モデル一覧](/api-reference/models/list-models)

## 統合アプローチ

### 当社のタクソノミーを直接使用

ユーザーに Legitmark カテゴリを表示：

<CodeGroup>
  ```javascript HTTP theme={null}
  const response = await fetch('https://api.legitmark.com/api/v2/categories?active_only=true', {
    headers: { 'Authorization': 'Bearer leo_xxxxxxxxx' }
  });
  const { data } = await response.json();

  data.forEach(category => {
    console.log(category.name); // "バッグ", "シューズ" など
  });
  ```

  ```typescript SDK theme={null}
  const { data: categories } = await legitmark.taxonomy.getCategories();

  for (const category of categories) {
    console.log(category.name);
  }
  ```
</CodeGroup>

### 選択したタイプのブランドを取得

<CodeGroup>
  ```javascript HTTP theme={null}
  const response = await fetch(
    `https://api.legitmark.com/api/v2/types/${typeUuid}/brands`,
    { headers: { 'Authorization': 'Bearer leo_xxxxxxxxx' } }
  );
  const { data: brands } = await response.json();
  ```

  ```typescript SDK theme={null}
  const { data: brands } = await legitmark.taxonomy.getBrandsForType(typeUuid);

  for (const brand of brands) {
    console.log(`${brand.name} (${brand.uuid})`);
  }
  ```
</CodeGroup>

### 既存のカテゴリをマッピング

プラットフォームのカテゴリを当社のカテゴリに変換：

```javascript theme={null}
const categoryMap = {
  "デザイナーハンドバッグ": "bags-category-uuid",
  "アスレチックシューズ": "shoes-category-uuid"
};

function getLegitmarkCategory(yourCategory) {
  return categoryMap[yourCategory];
}
```

## キャッシュ

パフォーマンス向上のためにタクソノミーデータをキャッシュします。新しいブランドやカテゴリが追加されるため、タクソノミーカタログは時間とともに変化するので、定期的な同期が重要です：

```javascript theme={null}
class TaxonomyCache {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.data = null;
    this.lastFetch = null;
  }

  async getTree() {
    const maxAge = 24 * 60 * 60 * 1000; // 24時間
    
    if (this.data && Date.now() - this.lastFetch < maxAge) {
      return this.data;
    }

    const response = await fetch('https://api.legitmark.com/api/v2/categories/tree?active_only=true', {
      headers: { 'Authorization': `Bearer ${this.apiKey}` }
    });
    
    this.data = await response.json();
    this.lastFetch = Date.now();
    
    return this.data;
  }
}
```

プラットフォームに追加された新しいカテゴリ、ブランド、モデルを取得するために毎日同期してください。

## 次のステップ

1. [ワークフローを設定](/ja/partner/workflow) - サービスリクエスト作成から画像アップロードまでのステップバイステッププロセス
2. [ステータスについて学ぶ](/ja/partner/service-request-states) - サービスリクエストの状態とワークフロー遷移

* [リアルタイムイベントを購読](/ja/webhook-reference/introduction) - Webhook 通知とステータス更新処理

### クイックリファレンス

* [インタラクティブ API リファレンス](/api-reference) - ライブ認証と詳細仕様ですべてのエンドポイントをテスト
