---
title: "Fetch item hierarchy details."
method: POST
path: "/V1/product/hierarchy"
tags: ["FetchProduct"]
---

# Fetch item hierarchy details.

`POST /V1/product/hierarchy`

## Request

- Base URL: `https://content1-api.1worldsync.com`
- URL: `https://content1-api.1worldsync.com/V1/product/hierarchy`
- Auth: none declared. Required headers: `appid`, `hashcode`
- TypeScript: <https://skmtc.dev/1worldsync/apis/1worldsync-content1-api/docs/V1/product/hierarchy/post.ts> (a function with typed inputs; its response is checked against the schema)

This method will return item hierarchy details based on a given search criteria and will return data with pagination. Page size can be mentioned in the "size" parameter. Using of "searchAfter" in request body loads next page.

## Query parameters

- `timestamp` string, required
- `pageSize` integer, required

## Headers

- `appid` string, required
- `hashcode` string, required
- `gln` unknown

## Request body

- FetchHierarchyRequest: Hierarchy search criteria
  - `gtin` string[], nullable: Item GTIN array
  - `ipGln` string, d{14}, nullable: Information Provider GLN
  - `lastModifiedDate` LastModifiedDate, nullable: Item last modified date
    - `from` DateField: LastModifiedDate To
      - `date` string: Date
      - `op` 'GT' | 'GTE' | 'LT' | 'LTE' | 'EQ': Date comparison operation type (ENUM)
    - `to` DateField: LastModifiedDate To
      - `date` string: Date
      - `op` 'GT' | 'GTE' | 'LT' | 'LTE' | 'EQ': Date comparison operation type (ENUM)
  - `sortFields` SortField[], nullable: Fields that will be sorted upon
    - `field` string: Fields that will be sorted upon. Ex: gtin, informationProviderGLN and targetMarket etc.
    - `desc` boolean
  - `searchAfter` object[], nullable: This field is used to fetch item in batch. To retrieve the next page of the items. You need to set searchAfter in search criteria from previous result.

## Response `200`

Returns item hierarchy details.

- HierarchyFetchResult: Hierarchy search result
  - `hierarchies` HierarchyDetails[]: Hierarchies of the item.
    - `gtin` string: Item GTIN.
    - `informationProviderGLN` string: Information provider GLN.
    - `targetMarket` string: Target market.
    - `hierarchy` ItemFetchHierarchy[]: Item hierarchy list.
      - `parentGtin` string
      - `gtin` string
      - `quantity` string
      - `children` ItemFetchHierarchy[]
  - `message` string: Response message.
  - `searchAfter` object[]: This value is used to fetch next page of hierarchies.

## Other responses

- `401`: For any Authorization, Authentication and validation error
- `500`: * Requested page size is grater than 1000 * Internal error occured

---

[API](https://skmtc.dev/1worldsync/apis/1worldsync-content1-api.md) - [All operations](https://skmtc.dev/1worldsync/apis/1worldsync-content1-api/llms.txt) - [OpenAPI document](https://skmtc.dev/1worldsync/apis/1worldsync-content1-api/revisions/6f66dfce857e?raw)
