---
title: "Get a tree-structure of suppliers of the given target"
method: GET
path: "/public/v2/suppliers/{systemId}/{targetId}/supplier-graph"
tags: ["Suppliers - Supplier Graph"]
deprecated: true
---

# Get a tree-structure of suppliers of the given target

`GET /public/v2/suppliers/{systemId}/{targetId}/supplier-graph`

> **Deprecated.**

⚠️ **DEPRECATED** - This endpoint is deprecated and will be removed at the end of December 2026.

---

## Migration Required

This endpoint has been replaced by the v1 Collections Tier-N API. Please migrate to the new endpoint:

### Replacement Endpoint

| Old Endpoint | New Endpoint | Purpose |
|--------------|--------------|---------|
| `GET /public/v2/suppliers/{systemId}/{targetId}/supplier-graph` | `GET /public/v1/collections/{collectionId}/tier-n/data` | Get collection-based supplier graphs |

---

## Why Migrate?

The v1 Collections Tier-N API provides significant improvements:

### 1. Collection-Based Approach
- **v2**: Works with individual target IDs
- **v1**: Works with collections, allowing you to analyze multiple suppliers together
- **v1**: Better integration with collection management workflows
- **v1**: Collection-level configuration for consistent analysis settings

### 2. Enhanced Functionality
- **v2**: Basic supplier graph with limited configuration
- **v1**: Advanced filtering through collection settings
- **v1**: Configurable data sources (customs, media, predictions)
- **v1**: Better control over scope (private, shared, public targets)

### 3. Improved Consistency
- **v2**: Target-specific endpoint
- **v1**: Aligned with collection-based API design
- **v1**: Consistent with other collection management endpoints

### 4. Better Documentation
- Comprehensive examples for all endpoints
- Detailed error response documentation
- Clear parameter descriptions
- Migration guidance and best practices

---

## Quick Migration Guide

### Step 1: Identify Collection ID

**Important**: The v1 endpoint requires a collection ID instead of a target ID. If you don't have a collection yet:

1. Create a collection using `POST /public/v1/collections`
2. Add your target to the collection using `POST /public/v1/collections/{collectionId}/targets`
3. Ensure the collection has tier-n enabled (`tiersEnabled: true`)

### Step 2: Update Endpoint Call

**Before:**
```http
GET /public/v2/suppliers/prewave/102006215/supplier-graph?tierLevel=3&commodityIds=101,102&filter={...}
```

**After:**
```http
GET /public/v1/collections/123/tier-n/data?tierLevel=3&commodityIds=101,102
```

### Step 3: Update Request Parameters

**v2 Parameters:**
- `systemId`: System identifier (path parameter)
- `targetId`: Target identifier (path parameter)
- `tierLevel`: Maximum tier level (query parameter, max 4)
- `commodityIds`: List of commodity IDs (query parameter)
- `filter`: Complex filter object (query parameter)
- `commodityTreeId`: Commodity tree ID (query parameter)
- `fetchParents`: Include parents (query parameter, default: true)

**v1 Parameters:**
- `collectionId`: Collection identifier (path parameter)
- `tierLevel`: Maximum tier level (query parameter, max 4)
- `commodityIds`: List of commodity IDs (query parameter)
- `commodityTreeId`: Commodity tree ID (query parameter)
- `fetchParents`: Include parents (query parameter, default: true)
- Filter options can be configured in collection settings using `PUT /public/v1/collections/{collectionId}/tier-n/settings`

### Step 4: Configure Collection Settings (Optional)

For advanced filtering, configure collection settings:

```http
PUT /public/v1/collections/123/tier-n/settings
{
  "maxTier": 3,
  "scopePrivate": true,
  "scopeShared": true,
  "sourceCustoms": true,
  "sourceMedia": true,
  "minShipments": 5,
  "probability": 75
}
```

---

## Breaking Changes

1. **Endpoint Path**: Changed from `/public/v2/suppliers/{systemId}/{targetId}/supplier-graph` to `/public/v1/collections/{collectionId}/tier-n/data`
2. **Path Parameters**:
   - **v2**: Requires `systemId` and `targetId`
   - **v1**: Requires `collectionId` (collection-based approach)
3. **Filter Configuration**:
   - **v2**: Filter passed as query parameter object
   - **v1**: Filter options configured in collection settings or passed as separate query parameters
4. **Response Structure**: May differ slightly - review response format
5. **Collection Requirement**: v1 requires targets to be part of a collection

---

## Important Notes

### Collection Requirement
- The v1 endpoint requires targets to be part of a collection
- If you're currently using this endpoint with individual targets, you'll need to:
  1. Create or identify a collection containing your target
  2. Ensure the collection has tier-n enabled (`tiersEnabled: true`)
  3. Use the collection ID instead of target ID

### Filter Migration
- Complex filter objects from v2 should be migrated to collection settings
- Use `GET /public/v1/collections/{collectionId}/tier-n/settings` to view current settings
- Use `PUT /public/v1/collections/{collectionId}/tier-n/settings` to configure filters

---

**Performance Impact**: High

For detailed API reference and examples, see the v1 Collections Tier-N API documentation.

## Path parameters

- `systemId` string, required
- `targetId` string, required

## Query parameters

- `tierLevel` integer
- `commodityIds` integer[]
- `filter` TargetSuppliersFilter, required
  - `query` string, nullable
  - `collectionIds` integer[], required
  - `commodityIds` integer[], required
  - `targetTypeIds` integer[], required
  - `tiers` integer[], required
  - `scopes` Scope[], required
  - `source` 'Customer' | 'Media' | 'Customs' | 'PrewavePrediction'
  - `countries` integer[]
  - `hscodes` string[], required
  - `lastShipment` string, date, nullable
  - `onlyDirectlySuppliers` boolean, required
  - `countryIds` integer[], required
- `commodityTreeId` integer
- `fetchParents` boolean

## Response `200`

Successfully retrieved supplier graph

- PublicTreeTargetV2[]
  - `target` integer, required — The target id of the supplier
  - `suppliers` PublicTreeTargetV2[], required — All sub-suppliers nested in the same structure
  - `targetInfo` PublicTargetInfoDTO, required — Information about the supplier (tier, path, collection)
    - `tier` integer, nullable — How far the supplier is away from the root supplier
    - `path` integer[], required — The path to the supplier, where the first element is the root supplier
    - `collectionLevel` integer, nullable — How deep the supplier is in the collection hierarchy
    - `collectionPath` integer[], required — The path to the collection, where the first element is the root collection
    - `collectionPaths` array[], nullable — List of collection paths per target with collection id as bottom level collection
      - integer[] — List of collection paths per target with collection id as bottom level collection
  - `edgeSource` string, required — Allowed values "Public Media", "Public Customs", "Private", "Shared", "Prewave Prediction"
  - `edgeInfo` PublicEdgeInfo
    - `hsCodes` PublicHSCode[], required
      - `code` string, required
      - `nShipments` integer, nullable
      - `nshipments` integer
    - `probability` number, double, nullable
  - `merged_targets` integer[] — Target ids of past targets that were merged into this current target

## Other responses

- `400` — Invalid request parameters (e.g., tier level > 4)
- `403` — 403 Forbidden - Authentication or authorization failure. This status code is returned when: (1) the request lacks valid authentication credentials (missing or invalid X-Auth-Token header), or (2) the authenticated user does not have the required permission to access this resource.
- `404` — Target not found or not accessible to the user
- `429` — 429 Too Many Requests - API rate limit exceeded. The request has been rejected because the rate limit for this endpoint has been exceeded. Default rate limits: GET requests - 100 per 10 seconds, 500 per minute; POST/PUT/PATCH/DELETE requests - 20 per 10 seconds, 100 per minute. For increased access, please contact customer success.
- `500` — 500 Internal Server Error - An unexpected error occurred on the server. The request may or may not have been processed.

---

[API](https://skmtc.net/prewave/apis/public-prewave-api.md) · [All operations](https://skmtc.net/prewave/apis/public-prewave-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prewave/public-prewave-api/revisions/466169815b78/schema)
