> 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.

# Add New Product

POST https://heimdall.eka.io/apis/external/product/addProduct
Content-Type: application/json

### Add New Product

This APIs endpoint allows you to add a new product to the Dice. The request should be sent as an HTTP POST to `hostName/apis/external/product/addProduct`.

### Request Body

| Params      | Required  | Type    | Description                                                                            |
| ----------- | --------- | ------- | -------------------------------------------------------------------------------------- |
| id          | Optional  | string  | The ID of the product.                                                                 |
| gl          | Optional  | string  | The GL code of the product.                                                            |
| title       | Mandatory | string  | The title or name of the product.                                                      |
| des         | Mandatory | string  | The description of the product.                                                        |
| sku         | Optional  | string  | The SKU (stock keeping unit) of the product.                                           |
| hsn         | Mandatory | string  | The HSN (Harmonized System of Nomenclature) code.                                      |
| category    | Mandatory | integer | The category of the product.  required only if serviceName not present in request body |
| serviceName | Optional  | String  | if category is provided in request body than this field required                       |
| tax         | Mandatory | integer | The tax rate applicable to the product.                                                |
| units       | Mandatory | string  | The units in which the product is measured.                                            |
| currency    | Optional  | string  | The currency in which the amount is specified.                                         |
| amount      | Mandatory | integer | The amount of the product.                                                             |
| sale        | Mandatory | boolean | Indicates if the product is available for sale.                                        |
| buy         | Mandatory | boolean | Indicates if the product is available for purchase.                                    |
| type        | Mandatory | string  | The type of the product.                                                               |
| image       | Mandatory | string  | The image URL of the product.                                                          |

### Response

* `success` (boolean): Indicates whether the product addition was successful.

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

## Servers

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

## Request

### 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

### Body (application/json)

- `id` (string, required)
- `gl` (string, required)
- `title` (string, required)
- `des` (string, required)
- `sku` (string, required)
- `hsn` (string, required)
- `category` (integer, required)
- `serviceName` (string, required)
- `tax` (integer, required)
- `units` (string, required)
- `currency` (string, required)
- `amount` (integer, required)
- `sale` (boolean, required)
- `buy` (boolean, required)
- `type` (string, required)
- `image` (string, required)

## Response

### 200

OK

- `success` (boolean, required)

## Examples

**Request**

```json
{
  "id": "",
  "gl": "",
  "title": "WaterBottle",
  "des": "test",
  "sku": "",
  "hsn": "1231",
  "category": 370,
  "serviceName": "",
  "tax": 8,
  "units": "Kg",
  "currency": "INR",
  "amount": 100,
  "sale": false,
  "buy": true,
  "type": "Service",
  "image": "1"
}
```

**Response**

```json
{
  "success": true
}
```

**SDK Code**

```python Product_Add New Product_example
import requests

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

payload = {
    "id": "",
    "gl": "",
    "title": "WaterBottle",
    "des": "test",
    "sku": "",
    "hsn": "1231",
    "category": 370,
    "serviceName": "",
    "tax": 8,
    "units": "Kg",
    "currency": "INR",
    "amount": 100,
    "sale": False,
    "buy": True,
    "type": "Service",
    "image": "1"
}
headers = {
    "DICE-APP-ID": "{{Company Code}}",
    "X-CLIENT-ID": "{{API Client ID}}",
    "X-CLIENT-SECRET": "{{API Client Secret}}",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Product_Add New Product_example
const url = 'https://heimdall.eka.io/apis/external/product/addProduct';
const options = {
  method: 'POST',
  headers: {
    'DICE-APP-ID': '{{Company Code}}',
    'X-CLIENT-ID': '{{API Client ID}}',
    'X-CLIENT-SECRET': '{{API Client Secret}}',
    'Content-Type': 'application/json'
  },
  body: '{"id":"","gl":"","title":"WaterBottle","des":"test","sku":"","hsn":"1231","category":370,"serviceName":"","tax":8,"units":"Kg","currency":"INR","amount":100,"sale":false,"buy":true,"type":"Service","image":"1"}'
};

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

```go Product_Add New Product_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"id\": \"\",\n  \"gl\": \"\",\n  \"title\": \"WaterBottle\",\n  \"des\": \"test\",\n  \"sku\": \"\",\n  \"hsn\": \"1231\",\n  \"category\": 370,\n  \"serviceName\": \"\",\n  \"tax\": 8,\n  \"units\": \"Kg\",\n  \"currency\": \"INR\",\n  \"amount\": 100,\n  \"sale\": false,\n  \"buy\": true,\n  \"type\": \"Service\",\n  \"image\": \"1\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	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}}")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Product_Add New Product_example
require 'uri'
require 'net/http'

url = URI("https://heimdall.eka.io/apis/external/product/addProduct")

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

request = Net::HTTP::Post.new(url)
request["DICE-APP-ID"] = '{{Company Code}}'
request["X-CLIENT-ID"] = '{{API Client ID}}'
request["X-CLIENT-SECRET"] = '{{API Client Secret}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"id\": \"\",\n  \"gl\": \"\",\n  \"title\": \"WaterBottle\",\n  \"des\": \"test\",\n  \"sku\": \"\",\n  \"hsn\": \"1231\",\n  \"category\": 370,\n  \"serviceName\": \"\",\n  \"tax\": 8,\n  \"units\": \"Kg\",\n  \"currency\": \"INR\",\n  \"amount\": 100,\n  \"sale\": false,\n  \"buy\": true,\n  \"type\": \"Service\",\n  \"image\": \"1\"\n}"

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

```java Product_Add New Product_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://heimdall.eka.io/apis/external/product/addProduct")
  .header("DICE-APP-ID", "{{Company Code}}")
  .header("X-CLIENT-ID", "{{API Client ID}}")
  .header("X-CLIENT-SECRET", "{{API Client Secret}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"id\": \"\",\n  \"gl\": \"\",\n  \"title\": \"WaterBottle\",\n  \"des\": \"test\",\n  \"sku\": \"\",\n  \"hsn\": \"1231\",\n  \"category\": 370,\n  \"serviceName\": \"\",\n  \"tax\": 8,\n  \"units\": \"Kg\",\n  \"currency\": \"INR\",\n  \"amount\": 100,\n  \"sale\": false,\n  \"buy\": true,\n  \"type\": \"Service\",\n  \"image\": \"1\"\n}")
  .asString();
```

```php Product_Add New Product_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://heimdall.eka.io/apis/external/product/addProduct', [
  'body' => '{
  "id": "",
  "gl": "",
  "title": "WaterBottle",
  "des": "test",
  "sku": "",
  "hsn": "1231",
  "category": 370,
  "serviceName": "",
  "tax": 8,
  "units": "Kg",
  "currency": "INR",
  "amount": 100,
  "sale": false,
  "buy": true,
  "type": "Service",
  "image": "1"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'DICE-APP-ID' => '{{Company Code}}',
    'X-CLIENT-ID' => '{{API Client ID}}',
    'X-CLIENT-SECRET' => '{{API Client Secret}}',
  ],
]);

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

```csharp Product_Add New Product_example
using RestSharp;

var client = new RestClient("https://heimdall.eka.io/apis/external/product/addProduct");
var request = new RestRequest(Method.POST);
request.AddHeader("DICE-APP-ID", "{{Company Code}}");
request.AddHeader("X-CLIENT-ID", "{{API Client ID}}");
request.AddHeader("X-CLIENT-SECRET", "{{API Client Secret}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"id\": \"\",\n  \"gl\": \"\",\n  \"title\": \"WaterBottle\",\n  \"des\": \"test\",\n  \"sku\": \"\",\n  \"hsn\": \"1231\",\n  \"category\": 370,\n  \"serviceName\": \"\",\n  \"tax\": 8,\n  \"units\": \"Kg\",\n  \"currency\": \"INR\",\n  \"amount\": 100,\n  \"sale\": false,\n  \"buy\": true,\n  \"type\": \"Service\",\n  \"image\": \"1\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Product_Add New Product_example
import Foundation

let headers = [
  "DICE-APP-ID": "{{Company Code}}",
  "X-CLIENT-ID": "{{API Client ID}}",
  "X-CLIENT-SECRET": "{{API Client Secret}}",
  "Content-Type": "application/json"
]
let parameters = [
  "id": "",
  "gl": "",
  "title": "WaterBottle",
  "des": "test",
  "sku": "",
  "hsn": "1231",
  "category": 370,
  "serviceName": "",
  "tax": 8,
  "units": "Kg",
  "currency": "INR",
  "amount": 100,
  "sale": false,
  "buy": true,
  "type": "Service",
  "image": "1"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://heimdall.eka.io/apis/external/product/addProduct")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```