---
title: "This method will return list of products for a given search criteria."
method: POST
path: "/V1/product/fetch"
tags: ["FetchProduct"]
---

# This method will return list of products for a given search criteria.

`POST /V1/product/fetch`

## Request

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

This method will search for products on a given search criteria and will return data in paged way. Page size can be mentioned in the request parameter. Using of "searchAfter" in request body will give you next page data.

## Query parameters

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

## Headers

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

## Request body

- ItemFetchRequest: Product search criteria object
  - `gtins` string[]
  - `pullHierarchy` boolean, nullable: Flag to indicate whether to include hierarchy in the response
  - `gtin` string[], nullable: Item GTIN array
  - `ipGln` string, d{14}, nullable: Information Provider GLN
  - `targetMarket` string, nullable: Target Market
  - `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)
  - `brandName` string, nullable: Brand name (supports wildcard)
  - `productType` string, nullable: Product Type
  - `isConsumerUnit` string, nullable: Consumer Unit
  - `gpcCode` string, nullable: GPC code or name (supports wildcard)
  - `upcCode` string, nullable: UPC code (supports wildcard)
  - `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
  - `fields` FetchFields, nullable: Fields to be include or exclude in result; By default all fields will be included
    - `include` string[]: To retrieve subset of attributes from item. Ex: ["gtin","informationProviderGLN","targetMarket","lastModifiedDate","brandName","gpcCategory","externalFileLink"]
    - `exclude` string[]: To abandon some of attributes from item. Ex: ["*.gln","externalFileLink.authorizedRecipients"]
  - `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`

Will return list of products.

- ItemFetchResult: Product search result
  - `items` Item[]
    - `objId` string: Elasticsearch objId
    - `gln` string: Item shared with gln
    - `dataPoolType` string: Item belongs to which data pool
    - `item` object: Item as map
  - `totalPages` integer: This field used to set total page number for given search criteria.
  - `currentPage` integer: This field used to set pagination page number.
  - `message` string: This field used to set any warning message.
  - `totalCount` integer: This field used to set total count.
  - `searchAfter` object[]: This field is used to fetch item in batch. To retrieve the next page of the items. You need to set it in search criteria.

## Other responses

- `204`: When no products found.
- `401`: For any Authorization, Authentication and validation error
- `500`: * when page size is more then 1000 * when error occurred in processing

---

[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)
