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

# Create PO Invoice

POST https://heimdall.eka.io/apis/external/invoice/createPoInvoice
Content-Type: application/json

### Request Body

The request should include the following parameters in the raw request body:

| Param                                    | Required  | Type   | Description                                                                                                        |
| ---------------------------------------- | --------- | ------ | ------------------------------------------------------------------------------------------------------------------ |
| po\_no                                   | Mandatory | String | Purchase order number                                                                                              |
| grn\_no                                  | Optional  | String | (Goods Receipt Note number), a unique identifier for the GRN, though it is not marked as required in this context. |
| request                                  | Mandatory | Object | Contains details of the purchase request                                                                           |
| request.vendor                           | Mandatory | Object | Vendor details                                                                                                     |
| request.vendor.code                      | Mandatory | String | Unique code for the vendor                                                                                         |
| request.vendor.id                        | optional  | Long   | Vendor identification number(vendor id is mandatory if code is not present)                                        |
| request.vendor.name                      | Mandatory | String | Name of the vendor                                                                                                 |
| request.vendorInvoiceNumber              | Mandatory | String | Invoice number provided by the vendor                                                                              |
| request.billDate                         | Mandatory | Long   | Date of the bill in Unix timestamp format                                                                          |
| request.category                         | Mandatory | Object | Category information                                                                                               |
| request.category.id                      | optional  | Long   | Category identification number (Category id is mandatory if label is not present)                                  |
| request.category.label                   | Mandatory | String | Label of the category                                                                                              |
| request.billTo                           | Mandatory | Object | Billing details                                                                                                    |
| request.billTo.name                      | Mandatory | String | Name of the entity to be billed                                                                                    |
| request.billTo.id                        | optional  | Long   | Billing entity identification number  (bill to id is mandatory if name is not present)                             |
| request.shipTo                           | Mandatory | Object | Shipping details                                                                                                   |
| request.shipTo.name                      | Mandatory | String | Name of the entity to receive the shipment                                                                         |
| request.shipTo.id                        | optional  | Long   | Shipping entity identification number  (ship to id is mandatory if name is not present)                            |
| request.roundOffAmount                   | optional  | Double | Amount rounded off                                                                                                 |
| request.items                            | Mandatory | Object | List of items included in the request                                                                              |
| request.items\[].base                    | Mandatory | Double | Base price of the item                                                                                             |
| request.items\[].product                 | Mandatory | Object | Product details                                                                                                    |
| request.items\[].product.code            | Mandatory | String | Unique code for the product                                                                                        |
| request.items\[].product.id              | Optional  | Long   | Product identification number(product id is mandatory if code is not present)                                      |
| request.items\[].product.itemReferenceNo | Mandatory | String | Reference number for the product                                                                                   |
| request.items\[].qtty                    | Mandatory | Double | Quantity of the product                                                                                            |
| request.items\[].notes                   | Optional  | String | Additional notes about the item                                                                                    |
| request.items\[].taxSlab                 | Optional  | Double | Tax percentage applicable to the item                                                                              |
| request.items\[].service                 | Mandatory | Object | Service details related to the item                                                                                |
| request.items\[].service.label           | Mandatory | String | Label of the service                                                                                               |
| request.items\[].service.value           | Mandatory | Long   | Cost of the service                                                                                                |
| request.items\[].tax                     | Mandatory | Double | Total tax amount for the item (tax is Mandatory if taxslab is present)                                             |

Upon successful execution, the API will return a status code of 200 and a JSON response with a `success` key indicating whether the invoice submission was successful.

### Example Response

```json
{    
"invoiceId": "VI-KARANDEVENV-000000493", 
"message": "Invoice Posted Successfully.",   
"success": true
}

```

Reference: https://open-api-docs.dice.tech/dice-standardized-ap-is-v-2-copy/invoice/create-po-invoice

## 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)
- `X-CLIENT-ID` (string, optional)
- `X-CLIENT-SECRET` (string, optional)

### Body (application/json)

- `po_no` (string, required)
- `request` (object, required)
  - `vendor` (object, required)
    - `code` (string, required)
    - `name` (string, required)
  - `vendorInvoiceNumber` (string, required)
  - `billDate` (integer, required)
  - `category` (object, required)
    - `label` (string, required)
  - `billTo` (object, required)
    - `name` (string, required)
  - `shipTo` (object, required)
    - `name` (string, required)
  - `baseAmount` (integer, required)
  - `roundOffAmount` (double, required)
  - `status` (string, required)
  - `items` (list of object, required)
    - `base` (integer, required)
    - `product` (object, required)
      - `code` (string, required)
      - `itemReferenceNo` (string, required)
    - `qtty` (integer, required)
    - `notes` (string, required)
    - `taxSlab` (integer, required)
    - `service` (object, required)
      - `label` (string, required)
      - `value` (integer, required)
    - `tax` (integer, required)
    - `data` (object, required)
      - `serialNumber` (string, required)
      - `warranty` (string, required)
  - `owner` (object, required)
    - `code` (string, required)

## Response

### 200

OK

- `invoiceId` (string, required)
- `message` (string, required)
- `success` (boolean, required)

## Examples

**Request**

```json
{
  "po_no": "PO-INDIAN-00728",
  "request": {
    "vendor": {
      "code": "CONTACT-INDIAN-0000063",
      "name": "BAKKIREDDY SRINIVASULU REDDY"
    },
    "vendorInvoiceNumber": "INV-000123456069",
    "billDate": 1795681600000,
    "category": {
      "label": "srinivas"
    },
    "billTo": {
      "name": "Pune_"
    },
    "shipTo": {
      "name": "Pune_"
    },
    "baseAmount": 1500,
    "roundOffAmount": 0.5,
    "status": "PENDING",
    "items": [
      {
        "base": 1000,
        "product": {
          "code": "911919",
          "itemReferenceNo": "329870"
        },
        "qtty": 5,
        "notes": "Office chairs",
        "taxSlab": 5,
        "service": {
          "label": "Delivery",
          "value": 100
        },
        "tax": 50,
        "data": {
          "serialNumber": "SN001",
          "warranty": "2 years"
        }
      }
    ],
    "owner": {
      "code": "e0099"
    }
  }
}
```

**Response**

```json
{
  "invoiceId": "VI-INDIAN-000002764",
  "message": "Invoice Posted Successfully.",
  "success": true
}
```

**SDK Code**

```python Invoice_Create PO Invoice_example
import requests

url = "https://heimdall.eka.io/apis/external/invoice/createPoInvoice"

payload = {
    "po_no": "PO-INDIAN-00728",
    "request": {
        "vendor": {
            "code": "CONTACT-INDIAN-0000063",
            "name": "BAKKIREDDY SRINIVASULU REDDY"
        },
        "vendorInvoiceNumber": "INV-000123456069",
        "billDate": 1795681600000,
        "category": { "label": "srinivas" },
        "billTo": { "name": "Pune_" },
        "shipTo": { "name": "Pune_" },
        "baseAmount": 1500,
        "roundOffAmount": 0.5,
        "status": "PENDING",
        "items": [
            {
                "base": 1000,
                "product": {
                    "code": "911919",
                    "itemReferenceNo": "329870"
                },
                "qtty": 5,
                "notes": "Office chairs",
                "taxSlab": 5,
                "service": {
                    "label": "Delivery",
                    "value": 100
                },
                "tax": 50,
                "data": {
                    "serialNumber": "SN001",
                    "warranty": "2 years"
                }
            }
        ],
        "owner": { "code": "e0099" }
    }
}
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 Invoice_Create PO Invoice_example
const url = 'https://heimdall.eka.io/apis/external/invoice/createPoInvoice';
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: '{"po_no":"PO-INDIAN-00728","request":{"vendor":{"code":"CONTACT-INDIAN-0000063","name":"BAKKIREDDY SRINIVASULU REDDY"},"vendorInvoiceNumber":"INV-000123456069","billDate":1795681600000,"category":{"label":"srinivas"},"billTo":{"name":"Pune_"},"shipTo":{"name":"Pune_"},"baseAmount":1500,"roundOffAmount":0.5,"status":"PENDING","items":[{"base":1000,"product":{"code":"911919","itemReferenceNo":"329870"},"qtty":5,"notes":"Office chairs","taxSlab":5,"service":{"label":"Delivery","value":100},"tax":50,"data":{"serialNumber":"SN001","warranty":"2 years"}}],"owner":{"code":"e0099"}}}'
};

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

```go Invoice_Create PO Invoice_example
package main

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

func main() {

	url := "https://heimdall.eka.io/apis/external/invoice/createPoInvoice"

	payload := strings.NewReader("{\n  \"po_no\": \"PO-INDIAN-00728\",\n  \"request\": {\n    \"vendor\": {\n      \"code\": \"CONTACT-INDIAN-0000063\",\n      \"name\": \"BAKKIREDDY SRINIVASULU REDDY\"\n    },\n    \"vendorInvoiceNumber\": \"INV-000123456069\",\n    \"billDate\": 1795681600000,\n    \"category\": {\n      \"label\": \"srinivas\"\n    },\n    \"billTo\": {\n      \"name\": \"Pune_\"\n    },\n    \"shipTo\": {\n      \"name\": \"Pune_\"\n    },\n    \"baseAmount\": 1500,\n    \"roundOffAmount\": 0.5,\n    \"status\": \"PENDING\",\n    \"items\": [\n      {\n        \"base\": 1000,\n        \"product\": {\n          \"code\": \"911919\",\n          \"itemReferenceNo\": \"329870\"\n        },\n        \"qtty\": 5,\n        \"notes\": \"Office chairs\",\n        \"taxSlab\": 5,\n        \"service\": {\n          \"label\": \"Delivery\",\n          \"value\": 100\n        },\n        \"tax\": 50,\n        \"data\": {\n          \"serialNumber\": \"SN001\",\n          \"warranty\": \"2 years\"\n        }\n      }\n    ],\n    \"owner\": {\n      \"code\": \"e0099\"\n    }\n  }\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 Invoice_Create PO Invoice_example
require 'uri'
require 'net/http'

url = URI("https://heimdall.eka.io/apis/external/invoice/createPoInvoice")

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  \"po_no\": \"PO-INDIAN-00728\",\n  \"request\": {\n    \"vendor\": {\n      \"code\": \"CONTACT-INDIAN-0000063\",\n      \"name\": \"BAKKIREDDY SRINIVASULU REDDY\"\n    },\n    \"vendorInvoiceNumber\": \"INV-000123456069\",\n    \"billDate\": 1795681600000,\n    \"category\": {\n      \"label\": \"srinivas\"\n    },\n    \"billTo\": {\n      \"name\": \"Pune_\"\n    },\n    \"shipTo\": {\n      \"name\": \"Pune_\"\n    },\n    \"baseAmount\": 1500,\n    \"roundOffAmount\": 0.5,\n    \"status\": \"PENDING\",\n    \"items\": [\n      {\n        \"base\": 1000,\n        \"product\": {\n          \"code\": \"911919\",\n          \"itemReferenceNo\": \"329870\"\n        },\n        \"qtty\": 5,\n        \"notes\": \"Office chairs\",\n        \"taxSlab\": 5,\n        \"service\": {\n          \"label\": \"Delivery\",\n          \"value\": 100\n        },\n        \"tax\": 50,\n        \"data\": {\n          \"serialNumber\": \"SN001\",\n          \"warranty\": \"2 years\"\n        }\n      }\n    ],\n    \"owner\": {\n      \"code\": \"e0099\"\n    }\n  }\n}"

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

```java Invoice_Create PO Invoice_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://heimdall.eka.io/apis/external/invoice/createPoInvoice")
  .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  \"po_no\": \"PO-INDIAN-00728\",\n  \"request\": {\n    \"vendor\": {\n      \"code\": \"CONTACT-INDIAN-0000063\",\n      \"name\": \"BAKKIREDDY SRINIVASULU REDDY\"\n    },\n    \"vendorInvoiceNumber\": \"INV-000123456069\",\n    \"billDate\": 1795681600000,\n    \"category\": {\n      \"label\": \"srinivas\"\n    },\n    \"billTo\": {\n      \"name\": \"Pune_\"\n    },\n    \"shipTo\": {\n      \"name\": \"Pune_\"\n    },\n    \"baseAmount\": 1500,\n    \"roundOffAmount\": 0.5,\n    \"status\": \"PENDING\",\n    \"items\": [\n      {\n        \"base\": 1000,\n        \"product\": {\n          \"code\": \"911919\",\n          \"itemReferenceNo\": \"329870\"\n        },\n        \"qtty\": 5,\n        \"notes\": \"Office chairs\",\n        \"taxSlab\": 5,\n        \"service\": {\n          \"label\": \"Delivery\",\n          \"value\": 100\n        },\n        \"tax\": 50,\n        \"data\": {\n          \"serialNumber\": \"SN001\",\n          \"warranty\": \"2 years\"\n        }\n      }\n    ],\n    \"owner\": {\n      \"code\": \"e0099\"\n    }\n  }\n}")
  .asString();
```

```php Invoice_Create PO Invoice_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://heimdall.eka.io/apis/external/invoice/createPoInvoice', [
  'body' => '{
  "po_no": "PO-INDIAN-00728",
  "request": {
    "vendor": {
      "code": "CONTACT-INDIAN-0000063",
      "name": "BAKKIREDDY SRINIVASULU REDDY"
    },
    "vendorInvoiceNumber": "INV-000123456069",
    "billDate": 1795681600000,
    "category": {
      "label": "srinivas"
    },
    "billTo": {
      "name": "Pune_"
    },
    "shipTo": {
      "name": "Pune_"
    },
    "baseAmount": 1500,
    "roundOffAmount": 0.5,
    "status": "PENDING",
    "items": [
      {
        "base": 1000,
        "product": {
          "code": "911919",
          "itemReferenceNo": "329870"
        },
        "qtty": 5,
        "notes": "Office chairs",
        "taxSlab": 5,
        "service": {
          "label": "Delivery",
          "value": 100
        },
        "tax": 50,
        "data": {
          "serialNumber": "SN001",
          "warranty": "2 years"
        }
      }
    ],
    "owner": {
      "code": "e0099"
    }
  }
}',
  '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 Invoice_Create PO Invoice_example
using RestSharp;

var client = new RestClient("https://heimdall.eka.io/apis/external/invoice/createPoInvoice");
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  \"po_no\": \"PO-INDIAN-00728\",\n  \"request\": {\n    \"vendor\": {\n      \"code\": \"CONTACT-INDIAN-0000063\",\n      \"name\": \"BAKKIREDDY SRINIVASULU REDDY\"\n    },\n    \"vendorInvoiceNumber\": \"INV-000123456069\",\n    \"billDate\": 1795681600000,\n    \"category\": {\n      \"label\": \"srinivas\"\n    },\n    \"billTo\": {\n      \"name\": \"Pune_\"\n    },\n    \"shipTo\": {\n      \"name\": \"Pune_\"\n    },\n    \"baseAmount\": 1500,\n    \"roundOffAmount\": 0.5,\n    \"status\": \"PENDING\",\n    \"items\": [\n      {\n        \"base\": 1000,\n        \"product\": {\n          \"code\": \"911919\",\n          \"itemReferenceNo\": \"329870\"\n        },\n        \"qtty\": 5,\n        \"notes\": \"Office chairs\",\n        \"taxSlab\": 5,\n        \"service\": {\n          \"label\": \"Delivery\",\n          \"value\": 100\n        },\n        \"tax\": 50,\n        \"data\": {\n          \"serialNumber\": \"SN001\",\n          \"warranty\": \"2 years\"\n        }\n      }\n    ],\n    \"owner\": {\n      \"code\": \"e0099\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Invoice_Create PO Invoice_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 = [
  "po_no": "PO-INDIAN-00728",
  "request": [
    "vendor": [
      "code": "CONTACT-INDIAN-0000063",
      "name": "BAKKIREDDY SRINIVASULU REDDY"
    ],
    "vendorInvoiceNumber": "INV-000123456069",
    "billDate": 1795681600000,
    "category": ["label": "srinivas"],
    "billTo": ["name": "Pune_"],
    "shipTo": ["name": "Pune_"],
    "baseAmount": 1500,
    "roundOffAmount": 0.5,
    "status": "PENDING",
    "items": [
      [
        "base": 1000,
        "product": [
          "code": "911919",
          "itemReferenceNo": "329870"
        ],
        "qtty": 5,
        "notes": "Office chairs",
        "taxSlab": 5,
        "service": [
          "label": "Delivery",
          "value": 100
        ],
        "tax": 50,
        "data": [
          "serialNumber": "SN001",
          "warranty": "2 years"
        ]
      ]
    ],
    "owner": ["code": "e0099"]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://heimdall.eka.io/apis/external/invoice/createPoInvoice")! 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()
```