> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://open-api-docs.dice.tech/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://open-api-docs.dice.tech/_mcp/server.

# Fetch Products API

GET https://heimdall.eka.io/apis/external/product/getProducts

### Fetch GRNs API

This API is to get all Product existing in Dice.

| **Params**  | **Required** | **Description**                                                                                                                                                             |
| ----------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| start\_date | Mandatory    | Date filter, from which date the Products needs to be fetched.    Format - **dd-MM-yyyy**                                                                                   |
| end\_date   | Mandatory    | Date filter, till which date the Products need to be fetched.    Format - **dd-MM-yyyy**                                                                                    |
| offset      | Mandatory    | Page Number                                                                                                                                                                 |
| pageSize    | Optional     | Number of Products to be fetched in a single page. Value cannot be greater than 5000.    If not provided along with the request then default value will be 1000 considered. |

### Response Body

| Params      | Type    | Description                                                      |
| ----------- | ------- | ---------------------------------------------------------------- |
| products    | Array   | An array containing details of various products.                 |
| active      | Boolean | Indicates whether the product is active.                         |
| id          | Integer | The unique ID of the product.                                    |
| unit        | String  | The unit of measurement for the product.                         |
| amount      | Integer | The amount associated with the product.                          |
| service     | String  | The service description of the product.                          |
| productId   | String  | The unique ID of the product.                                    |
| currency    | String  | The currency code for the product.                               |
| title       | String  | The title or name of the product.                                |
| image       | String  | The URL or base64-encoded representation of the product's image. |
| hsn         | String  | The Harmonized System Nomenclature (HSN) code for the product.   |
| sku         | String  | The Stock Keeping Unit (SKU) for the product.                    |
| glcode      | String  | The General Ledger (GL) code associated with the product.        |
| type        | String  | The type of the product.                                         |
| description | String  | The description or details of the product.                       |
| tax         | String  | The tax rate associated with the product.                        |
| orders      | Integer | The number of orders for the product.                            |
| orderAt     | Integer | Timestamp indicating when the product was ordered.               |
| sale        | Boolean | Indicates whether the product is available for sale.             |
| purchase    | Boolean | Indicates whether the product is available for purchase.         |
| total       | Integer | The total number of products.                                    |
| currentPage | Integer | The current page number.                                         |
| totalPages  | Integer | The total number of pages based on the page size.                |

### Response

```json
{
  "products": [
    {
      "active": true,
      "id": 29286,
      "unit": "kg",
      "amount": 10,
      "service": "abc",
      "productId": "test",
      "currency": "AED",
      "title": "testt",
      "image": "https://example.com/image1",
      "hsn": "test",
      "sku": "test",
      "glcode": "test",
      "type": "product",
      "description": "est",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": false,
      "id": 33060,
      "unit": "ton",
      "amount": 1111,
      "service": "Budget Test Service 1",
      "productId": "PRODUCT-INDIAN-0000003",
      "currency": "INR",
      "title": "title1",
      "image": "https://example.com/image2",
      "hsn": "2312",
      "sku": "sku1",
      "glcode": "123123",
      "type": "product",
      "description": "desc1",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": false,
      "purchase": true
    },
    // ... (additional product entries)
  ],
  "total": 16,
  "currentPage": 1,
  "totalPages": 1
}

```

Reference: https://open-api-docs.dice.tech/dice-standardized-ap-is-v-2-copy/product/fetch-products-api

## Servers

- `https://heimdall.eka.io` (https://heimdall.eka.io, default)
- `https://heimdall.eka.ioapis` (https://heimdall.eka.ioapis)

## Request

### Query parameters

- `offset` (integer, optional) — Offset starts from 0 (Page Number), values can be 0, 1, 2
- `pageSize` (integer, optional) — optinal parameter, default is 1000
- `start_date` (string, optional) — Date should be in dd-MM-yyyy format and it runs on CreatedAt
- `end_date` (string, optional) — Date should be in dd-MM-yyyy format and it runs on CreatedAt

### Headers

- `DICE-APP-ID` (string, optional) — Company Code of client
- `X-CLIENT-ID` (string, optional) — API Client ID
- `X-CLIENT-SECRET` (string, optional) — API Client Secret

## Response

### 200

OK

- `products` (list of object, required)
  - `active` (boolean, required)
  - `id` (integer, required)
  - `unit` (string, required)
  - `amount` (integer, required)
  - `service` (string, required)
  - `productId` (string, required)
  - `currency` (string, required)
  - `title` (string, required)
  - `image` (string, required)
  - `hsn` (string, required)
  - `sku` (string, required)
  - `glcode` (string, required)
  - `type` (string, required)
  - `description` (string, required)
  - `tax` (string, required)
  - `orders` (integer, required)
  - `orderAt` (integer, required)
  - `sale` (boolean, required)
  - `purchase` (boolean, required)
- `total` (integer, required)
- `currentPage` (integer, required)
- `totalPages` (integer, required)

## Examples

**Response**

```json
{
  "products": [
    {
      "active": true,
      "id": 29286,
      "unit": "kg",
      "amount": 10,
      "service": "abc",
      "productId": "test",
      "currency": "AED",
      "title": "testt",
      "image": "",
      "hsn": "test",
      "sku": "test",
      "glcode": "test",
      "type": "product",
      "description": "est",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": false,
      "id": 33060,
      "unit": "ton",
      "amount": 1111,
      "service": "Budget Test Service 1",
      "productId": "PRODUCT-INDIAN-0000003",
      "currency": "INR",
      "title": "title1",
      "image": "",
      "hsn": "2312",
      "sku": "sku1",
      "glcode": "123123",
      "type": "product",
      "description": "desc1",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": false,
      "purchase": true
    },
    {
      "active": true,
      "id": 37221,
      "unit": "kg",
      "amount": 31,
      "service": "abc",
      "productId": "323",
      "currency": "INR",
      "title": "test009",
      "image": "",
      "hsn": "435",
      "sku": "345",
      "glcode": "23",
      "type": "product",
      "description": "rrr",
      "tax": "10.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37468,
      "unit": "kg",
      "amount": 1000,
      "service": "karan",
      "productId": "PRODUCT-INDIAN-0000004",
      "currency": "INR",
      "title": "Macbook",
      "image": "",
      "hsn": "hiosp",
      "sku": "IO",
      "glcode": "",
      "type": "product",
      "description": "Macbook",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37469,
      "unit": "Nos",
      "amount": 22,
      "service": "karan",
      "productId": "PRODUCT-INDIAN-0000005",
      "currency": "INR",
      "title": "Mouse",
      "image": "",
      "hsn": "MSN",
      "sku": "Mouse",
      "glcode": "",
      "type": "product",
      "description": "Mouse",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37470,
      "unit": "Nos",
      "amount": 200,
      "service": "karan",
      "productId": "PRODUCT-INDIAN-0000006",
      "currency": "INR",
      "title": "Keyboard",
      "image": "",
      "hsn": "KBD",
      "sku": "Keyboard",
      "glcode": "Keyboard",
      "type": "product",
      "description": "Keyboard",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37471,
      "unit": "Nos",
      "amount": 2000,
      "service": "karan",
      "productId": "PRODUCT-INDIAN-0000007",
      "currency": "INR",
      "title": "IT Consumable",
      "image": "",
      "hsn": "ICB",
      "sku": "IPO",
      "glcode": "IT Consumable",
      "type": "product",
      "description": "IT Consumable",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37472,
      "unit": "Nos",
      "amount": 5000,
      "service": "karan",
      "productId": "PRODUCT-INDIAN-0000008",
      "currency": "INR",
      "title": "HDMI Cable",
      "image": "",
      "hsn": "HDMI Cable",
      "sku": "HDMI Cable",
      "glcode": "HDMI Cable",
      "type": "product",
      "description": "HDMI Cable",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37473,
      "unit": "Nos",
      "amount": 500,
      "service": "abc",
      "productId": "PRODUCT-INDIAN-0000009",
      "currency": "INR",
      "title": "Storage",
      "image": "",
      "hsn": "Storage",
      "sku": "Storage",
      "glcode": "Storage",
      "type": "product",
      "description": "Storage",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37474,
      "unit": "kg",
      "amount": 1000,
      "service": "karan",
      "productId": "PRODUCT-INDIAN-0000010",
      "currency": "INR",
      "title": "Speaker Cable",
      "image": "",
      "hsn": "SC",
      "sku": "SC",
      "glcode": "Speaker Cable",
      "type": "product",
      "description": "Speaker Cable",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37475,
      "unit": "Nos",
      "amount": 60,
      "service": "karan",
      "productId": "PRODUCT-INDIAN-0000011",
      "currency": "INR",
      "title": "Printers",
      "image": "",
      "hsn": "Printers",
      "sku": "Printers",
      "glcode": "Printers",
      "type": "product",
      "description": "Printers",
      "tax": "5.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37632,
      "unit": "kg",
      "amount": 700,
      "service": "karan",
      "productId": "fds",
      "currency": "INR",
      "title": "232",
      "image": "",
      "hsn": "32",
      "sku": "32",
      "glcode": "fds",
      "type": "product",
      "description": "32",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37633,
      "unit": "kg",
      "amount": 600,
      "service": "karan",
      "productId": "ip",
      "currency": "INR",
      "title": "ip",
      "image": "",
      "hsn": "ip",
      "sku": "ip",
      "glcode": "ip",
      "type": "product",
      "description": "ip",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37634,
      "unit": "kg",
      "amount": 5,
      "service": "Administrative Expenses A/c",
      "productId": "PRODUCT-INDIAN-0000012",
      "currency": "INR",
      "title": "ewwe",
      "image": "",
      "hsn": "fds",
      "sku": "fds",
      "glcode": "iop",
      "type": "product",
      "description": "dsdsd",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    },
    {
      "active": true,
      "id": 37677,
      "unit": "Nos",
      "amount": 250,
      "service": "Administrative Expenses A/c",
      "productId": "Yash Testing",
      "currency": "INR",
      "title": "Mobilephone",
      "image": "",
      "hsn": "HSN43421",
      "sku": "37733",
      "glcode": "12321",
      "type": "product",
      "description": "handset",
      "tax": "0.0",
      "orders": 0,
      "orderAt": 0,
      "sale": true,
      "purchase": true
    }
  ],
  "total": 16,
  "currentPage": 1,
  "totalPages": 1
}
```

**SDK Code**

```python Product_Fetch Products API_example
import requests

url = "https://heimdall.eka.io/apis/external/product/getProducts"

querystring = {"end_date":"13-06-2023","offset":"0","pageSize":"1000","start_date":"01-06-2022"}

headers = {
    "DICE-APP-ID": "{{Company Code}}",
    "X-CLIENT-ID": "{{API Client ID}}",
    "X-CLIENT-SECRET": "{{API Client Secret}}"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Product_Fetch Products API_example
const url = 'https://heimdall.eka.io/apis/external/product/getProducts?end_date=13-06-2023&offset=0&pageSize=1000&start_date=01-06-2022';
const options = {
  method: 'GET',
  headers: {
    'DICE-APP-ID': '{{Company Code}}',
    'X-CLIENT-ID': '{{API Client ID}}',
    'X-CLIENT-SECRET': '{{API Client Secret}}'
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Product_Fetch Products API_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://heimdall.eka.io/apis/external/product/getProducts?end_date=13-06-2023&offset=0&pageSize=1000&start_date=01-06-2022"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("DICE-APP-ID", "{{Company Code}}")
	req.Header.Add("X-CLIENT-ID", "{{API Client ID}}")
	req.Header.Add("X-CLIENT-SECRET", "{{API Client Secret}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Product_Fetch Products API_example
require 'uri'
require 'net/http'

url = URI("https://heimdall.eka.io/apis/external/product/getProducts?end_date=13-06-2023&offset=0&pageSize=1000&start_date=01-06-2022")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["DICE-APP-ID"] = '{{Company Code}}'
request["X-CLIENT-ID"] = '{{API Client ID}}'
request["X-CLIENT-SECRET"] = '{{API Client Secret}}'

response = http.request(request)
puts response.read_body
```

```java Product_Fetch Products API_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://heimdall.eka.io/apis/external/product/getProducts?end_date=13-06-2023&offset=0&pageSize=1000&start_date=01-06-2022")
  .header("DICE-APP-ID", "{{Company Code}}")
  .header("X-CLIENT-ID", "{{API Client ID}}")
  .header("X-CLIENT-SECRET", "{{API Client Secret}}")
  .asString();
```

```php Product_Fetch Products API_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://heimdall.eka.io/apis/external/product/getProducts?end_date=13-06-2023&offset=0&pageSize=1000&start_date=01-06-2022', [
  'headers' => [
    'DICE-APP-ID' => '{{Company Code}}',
    'X-CLIENT-ID' => '{{API Client ID}}',
    'X-CLIENT-SECRET' => '{{API Client Secret}}',
  ],
]);

echo $response->getBody();
```

```csharp Product_Fetch Products API_example
using RestSharp;

var client = new RestClient("https://heimdall.eka.io/apis/external/product/getProducts?end_date=13-06-2023&offset=0&pageSize=1000&start_date=01-06-2022");
var request = new RestRequest(Method.GET);
request.AddHeader("DICE-APP-ID", "{{Company Code}}");
request.AddHeader("X-CLIENT-ID", "{{API Client ID}}");
request.AddHeader("X-CLIENT-SECRET", "{{API Client Secret}}");
IRestResponse response = client.Execute(request);
```

```swift Product_Fetch Products API_example
import Foundation

let headers = [
  "DICE-APP-ID": "{{Company Code}}",
  "X-CLIENT-ID": "{{API Client ID}}",
  "X-CLIENT-SECRET": "{{API Client Secret}}"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://heimdall.eka.io/apis/external/product/getProducts?end_date=13-06-2023&offset=0&pageSize=1000&start_date=01-06-2022")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```