ProductsList Your Products

List Products

curl -X GET "https://connect.wholechain.com/Integration/Products?SharingPolicies=Open&ShowArchived=true&PageNumber=1&PageSize=10" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: example_string"
{
  "grossCount": 82,
  "totalPages": 9,
  "pageNumber": 1,
  "pageSize": 10,
  "totalItems": 82,
  "results": [
    {
      "id": "123456",
      "urn": "urn:gdst:wholechain.com:product:class:raindropsolutions.sampleproduct-1",
      "details": {
        "name": "Sample Product",
        "simpleUnitOfMeasurement": "Kgm",
        "unitQuantity": 2,
        "sharingPolicy": "Open",
        "productIdentifierType": "Lot",
        "unitDescriptor": "Cases",
        "gtin": "12345678912343",
        "productMasterData": [],
        "plu": "4001"
      },
      "updateIfExists": false
    }
  ],
  "hasNextPage": true,
  "hasPreviousPage": false
}
GET
/Integration/Products
GET
Base URLstring

Target server for requests. Edit to use your own host.

query
SharingPoliciesstring

Filter by sharing policy. Supported values are Open and Restricted.

Options: Open, Restricted
query
ShowArchivedboolean

Return archived products when true; non-archived products when false.

query
PageNumberinteger

Default 1, minimum 1.

Min: 1
query
PageSizeinteger

Default 20, minimum 1.

Min: 1
header
X-API-KEYstring
Required

API key used to authenticate the request.

Request Preview
Response

Response will appear here after sending the request

Responses

grossCountinteger
Required

Total number of products before pagination.

totalPagesinteger
Required

Total number of result pages.

pageNumberinteger
Required

Current page number.

pageSizeinteger
Required

Maximum number of products per page.

totalItemsinteger
Required

Total number of matching products.

resultsarray
Required
hasNextPageboolean
Required

Indicates whether another page of results is available.

hasPreviousPageboolean
Required

Indicates whether a previous page of results is available.

Introduction

The Get Products API allows you to retrieve a list of products available within your Wholechain account.

All query parameters are optional. You can filter the results by:

  • Sharing policy
  • Archived status
  • Page number
  • Page size

If PageNumber and PageSize are omitted, the first page of 20 products is returned. Use PageNumber, PageSize and hasNextPage to read all products.


Request Headers

HeaderRequiredDescriptionExample Value
X-API-KEYYesAPI key used to authenticate the request.YOUR_API_KEY
acceptNoResponse content type.text/plain

Query Parameters

All query parameters are optional.

ParameterData TypeRequiredDescriptionExample
SharingPoliciesSTRINGNoFilters products by sharing policy. Supported values are Open and Restricted. If omitted, products with all sharing policies are returned.Open/Restricted
ShowArchivedBOOLEANNoFilters products based on their archived status. See behavior below.true/false
PageNumberINTEGERNoPage number to return. Default 1, minimum 1.1
PageSizeINTEGERNoNumber of products per page. Default 20, minimum 1.10

Sharing Policy Filter

The SharingPolicies parameter can be used to return products based on their sharing policy.

ValueResult
OpenReturns products with an Open sharing policy.
RestrictedReturns products with a Restricted sharing policy.
Not providedReturns products regardless of sharing policy.

Archived Product Filter

The ShowArchived parameter determines whether archived or non-archived products are returned.

ShowArchived ValueResult
trueReturns archived products only.
falseReturns non-archived products only.
Not providedReturns both archived and non-archived products.

Pagination

PageNumber and PageSize can optionally be used to paginate the results.

If PageNumber and PageSize are omitted, the first page of 20 products is returned. Use PageNumber, PageSize and hasNextPage to read all products.

If PageNumber or PageSize is less than 1, the API returns HTTP 400 with the plain JSON string "PageNumber and PageSize must be greater than 0.".


Get Products (first page)

To retrieve the first page of products, call the endpoint with only your API key.

curl -X 'GET' \
  'https://connect.wholechain.com/Integration/Products' \
  -H 'accept: text/plain' \
  -H 'X-API-KEY: YOUR_API_KEY'

This returns the first page of 20 products without applying sharing policy or archived status filters.


Example With Filters

The following example returns:

  • Products with an Open sharing policy
  • Archived products only
  • Page 10
  • 10 products per page
curl -X 'GET' \
  'https://connect.wholechain.com/Integration/Products?SharingPolicies=Open&ShowArchived=true&PageNumber=10&PageSize=10' \
  -H 'accept: text/plain' \
  -H 'X-API-KEY: YOUR_API_KEY'

Example Requests

RequirementRequest
First page of products/Integration/Products
Open products/Integration/Products?SharingPolicies=Open
Restricted products/Integration/Products?SharingPolicies=Restricted
Archived products only/Integration/Products?ShowArchived=true
Non-archived products only/Integration/Products?ShowArchived=false
First 10 products/Integration/Products?PageNumber=1&PageSize=10
Open, archived products/Integration/Products?SharingPolicies=Open&ShowArchived=true

Example Response

{
  "grossCount": 82,
  "totalPages": 9,
  "pageNumber": 1,
  "pageSize": 10,
  "totalItems": 82,
  "results": [
    {
      "id": "123456",
      "urn": "urn:gdst:wholechain.com:product:class:raindropsolutions.sampleproduct-1",
      "details": {
        "name": "Sample Product",
        "simpleUnitOfMeasurement": "Kgm",
        "unitQuantity": 2,
        "sharingPolicy": "Open",
        "productIdentifierType": "Lot",
        "unitDescriptor": "Cases",
        "gtin": "12345678912343",
        "productMasterData": [],
        "plu": "4001"
      },
      "updateIfExists": false
    }
  ],
  "hasNextPage": true,
  "hasPreviousPage": false
}

Response Pagination Fields

FieldDescription
totalPagesTotal number of pages available.
pageNumberCurrent page number.
pageSizeNumber of products returned per page.
totalItemsTotal number of matching products.
resultsArray containing the products returned for the current page.
hasNextPageIndicates whether another page of results is available.
hasPreviousPageIndicates whether a previous page of results is available.

Important Notes

  • Only the X-API-KEY header is required.
  • All query parameters are optional.
  • If SharingPolicies is omitted, products from all sharing policies are returned.
  • If ShowArchived is omitted, both archived and non-archived products are returned.
  • PageNumber and PageSize are only required if you want to control pagination.
  • Calling the base endpoint with only the API key returns the first page of 20 products.