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

POST https://heimdall.eka.io/apis/external/po/create
Content-Type: application/json

### Create Po API

This API endpoint is used to create a purchase order externally. The request should be sent as an HTTP POST to the specified URL. The request body should be in raw format and include data related to the owner, currency, billTo, shipTo, category, delivery date, list of items, vendor, attributes, forms, end date, contract ID, type, logo, posting details, and purchase order number.

### Request Body

| Param              | Required  | Type    | Description                                             |
| ------------------ | --------- | ------- | ------------------------------------------------------- |
| data               | Mandatory | Object  | Main container for purchase order data.                 |
| owner              | Mandatory | Object  | Details about the owner of the purchase order.          |
| ownerName          | Mandatory | String  | Name of the owner.                                      |
| ownerEmail         | Mandatory | String  | Email address of the owner.                             |
| currency           | Mandatory | String  | The currency code for the purchase order (e.g., "INR"). |
| superId            | Optional  | Integer | Super ID associated with the purchase order.            |
| billTo             | Mandatory | Object  | Billing information.                                    |
| name               | Mandatory | String  | Name for billing.                                       |
| value              | Mandatory | Integer | Billing value.                                          |
| shipTo             | Mandatory | Object  | Shipping information.                                   |
| name               | Mandatory | String  | Name for shipping.                                      |
| value              | Mandatory | Integer | Shipping value.                                         |
| category           | Mandatory | Object  | Category information.                                   |
| id                 | Mandatory | Integer | Category ID.                                            |
| label              | Mandatory | String  | Category label.                                         |
| deliveryDate       | Mandatory | Integer | Delivery date associated with the purchase order.       |
| list               | Mandatory | Array   | Array of items in the purchase order.                   |
| base               | Mandatory | Number  | Base amount for the item.                               |
| product            | Mandatory | Object  | Product details.                                        |
| label              | Mandatory | String  | Label of the product.                                   |
| value              | Mandatory | Integer | Value of the product.                                   |
| itemReferenceNo    | Mandatory | String  | Item reference number.                                  |
| isMaster           | Mandatory | Boolean | Indicates if it's a master product.                     |
| productId          | Mandatory | String  | ID of the product.                                      |
| gl                 | Optional  | String  | General ledger code.                                    |
| image              | Optional  | String  | URL or base64-encoded representation of the image.      |
| title              | Optional  | String  | Title of the product.                                   |
| desc               | Optional  | String  | Description of the product.                             |
| currency           | Mandatory | String  | Currency of the product.                                |
| hsn                | Optional  | String  | Harmonized System Nomenclature code.                    |
| sku                | Optional  | String  | Stock Keeping Unit code.                                |
| type               | Optional  | String  | Type of the product.                                    |
| service            | Optional  | String  | Indicates if it's a service.                            |
| units              | Optional  | String  | Units of the product.                                   |
| sale               | Mandatory | Boolean | Indicates if the product is for sale.                   |
| amount             | Mandatory | Number  | Amount of the product.                                  |
| buy                | Mandatory | Boolean | Indicates if the product is for purchase.               |
| taxCode            | Optional  | String  | Tax code for the product.                               |
| qtty               | Mandatory | Number  | Quantity of the item.                                   |
| notes              | Optional  | String  | Additional notes for the item.                          |
| contractItemId     | Mandatory | String  | Contract item ID.                                       |
| title              | Mandatory | String  | Title of the purchase order.                            |
| vendor             | Mandatory | Object  | Vendor information.                                     |
| id                 | Mandatory | Integer | Vendor ID.                                              |
| registeredId       | Mandatory | String  | Registered ID of the vendor.                            |
| attrs              | Optional  | Object  | Additional attributes.                                  |
| forms              | Optional  | Object  | Forms associated with the purchase order.               |
| endDate            | Optional  | Integer | End date of the purchase order.                         |
| contractId         | Optional  | Integer | Contract ID.                                            |
| type               | Optional  | String  | Type of purchase order.                                 |
| logo               | Optional  | String  | URL or base64-encoded representation of the logo.       |
| postingTriggeredAt | Optional  | Integer | Timestamp when posting was triggered.                   |
| postingErrors      | Optional  | String  | Errors encountered during posting.                      |
| postingDocNo       | Optional  | String  | Document number generated during posting.               |
| postingTriggered   | Optional  | Boolean | Indicates if posting was triggered.                     |
| postingFailed      | Optional  | Boolean | Indicates if posting failed.                            |
| po\_no             | Optional  | String  | Purchase order number.                                  |

### Response

| Param       | Type    | Description                                                                                                                           |
| ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| vouchers    | Array   | Contains the list of vouchers with various details such as ID, employee information, currency, amounts, status, and other attributes. |
| total       | Integer | Represents the total number of vouchers available.                                                                                    |
| currentPage | Integer | Indicates the current page number.                                                                                                    |
| totalPages  | Integer | Specifies the total number of pages based on the pageSize.                                                                            |

Example Response:

```json
{
    "orderId": "PO-INDIAN-00412",
    "success": true,
    "message": "PO created successfully"
}

```

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

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

- `data` (object, required)
  - `owner` (object, required)
    - `ownerName` (string, required)
    - `ownerEmail` (string, required)
  - `currency` (string, required)
  - `superId` (integer, required)
  - `billTo` (object, required)
    - `name` (string, required)
    - `value` (integer, required)
  - `shipTo` (object, required)
    - `name` (string, required)
    - `value` (integer, required)
  - `category` (object, required)
    - `id` (integer, required)
    - `label` (string, required)
  - `deliveryDate` (integer, required)
  - `list` (list of object, required)
    - `base` (integer, required)
    - `product` (object, required)
      - `label` (string, required)
      - `value` (integer, required)
      - `itemReferenceNo` (string, required)
      - `isMaster` (boolean, required)
      - `productId` (string, required)
      - `gl` (string, required)
      - `image` (string, required)
      - `title` (string, required)
      - `desc` (string, required)
      - `currency` (string, required)
      - `hsn` (string, required)
      - `sku` (string, required)
      - `type` (string, required)
      - `service` (string, required)
      - `units` (string, required)
      - `sale` (boolean, required)
      - `amount` (integer, required)
      - `buy` (boolean, required)
      - `taxCode` (string, required)
    - `qtty` (integer, required)
    - `notes` (string, required)
    - `contractItemId` (string, required)
  - `title` (string, required)
  - `vendor` (object, required)
    - `id` (integer, required)
    - `registeredId` (string, required)
  - `attrs` (object, required)
    - `{String}` (string, required)
  - `forms` (object, required)
  - `endDate` (integer, required)
  - `contractId` (integer, required)
  - `type` (string, required)
  - `logo` (string, required)
  - `postingTriggeredAt` (integer, required)
  - `postingErrors` (string, required)
  - `postingDocNo` (string, required)
  - `postingTriggered` (boolean, required)
  - `postingFailed` (boolean, required)
  - `po_no` (string, required)

## Response

### 200

OK

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

## Examples

**Request**

```json
{
  "data": {
    "owner": {
      "ownerName": "test",
      "ownerEmail": "test"
    },
    "currency": "INR",
    "superId": 12,
    "billTo": {
      "name": "test",
      "value": 1
    },
    "shipTo": {
      "name": "test2",
      "value": 1
    },
    "category": {
      "id": 1,
      "label": "test"
    },
    "deliveryDate": 12,
    "list": [
      {
        "base": 10,
        "product": {
          "label": "test",
          "value": 10,
          "itemReferenceNo": "",
          "isMaster": false,
          "productId": "test",
          "gl": "",
          "image": "",
          "title": "",
          "desc": "",
          "currency": "INR",
          "hsn": "",
          "sku": "",
          "type": "",
          "service": "",
          "units": "",
          "sale": false,
          "amount": 10,
          "buy": true,
          "taxCode": ""
        },
        "qtty": 10,
        "notes": "",
        "contractItemId": "test"
      }
    ],
    "title": "test",
    "vendor": {
      "id": 299503,
      "registeredId": "121"
    },
    "attrs": {
      "{String}": ""
    },
    "forms": {},
    "endDate": 14,
    "contractId": 0,
    "type": "",
    "logo": "",
    "postingTriggeredAt": 0,
    "postingErrors": "",
    "postingDocNo": "",
    "postingTriggered": false,
    "postingFailed": false,
    "po_no": "1212121212"
  }
}
```

**Response**

```json
{
  "orderId": "PO-INDIAN-00412",
  "success": true,
  "message": "PO created successfully"
}
```

**SDK Code**

```python Purchase Orders(PO)_Create PO API_example
import requests

url = "https://heimdall.eka.io/apis/external/po/create"

payload = { "data": {
        "owner": {
            "ownerName": "test",
            "ownerEmail": "test"
        },
        "currency": "INR",
        "superId": 12,
        "billTo": {
            "name": "test",
            "value": 1
        },
        "shipTo": {
            "name": "test2",
            "value": 1
        },
        "category": {
            "id": 1,
            "label": "test"
        },
        "deliveryDate": 12,
        "list": [
            {
                "base": 10,
                "product": {
                    "label": "test",
                    "value": 10,
                    "itemReferenceNo": "",
                    "isMaster": False,
                    "productId": "test",
                    "gl": "",
                    "image": "",
                    "title": "",
                    "desc": "",
                    "currency": "INR",
                    "hsn": "",
                    "sku": "",
                    "type": "",
                    "service": "",
                    "units": "",
                    "sale": False,
                    "amount": 10,
                    "buy": True,
                    "taxCode": ""
                },
                "qtty": 10,
                "notes": "",
                "contractItemId": "test"
            }
        ],
        "title": "test",
        "vendor": {
            "id": 299503,
            "registeredId": "121"
        },
        "attrs": { "{String}": "" },
        "forms": {},
        "endDate": 14,
        "contractId": 0,
        "type": "",
        "logo": "",
        "postingTriggeredAt": 0,
        "postingErrors": "",
        "postingDocNo": "",
        "postingTriggered": False,
        "postingFailed": False,
        "po_no": "1212121212"
    } }
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 Purchase Orders(PO)_Create PO API_example
const url = 'https://heimdall.eka.io/apis/external/po/create';
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: '{"data":{"owner":{"ownerName":"test","ownerEmail":"test"},"currency":"INR","superId":12,"billTo":{"name":"test","value":1},"shipTo":{"name":"test2","value":1},"category":{"id":1,"label":"test"},"deliveryDate":12,"list":[{"base":10,"product":{"label":"test","value":10,"itemReferenceNo":"","isMaster":false,"productId":"test","gl":"","image":"","title":"","desc":"","currency":"INR","hsn":"","sku":"","type":"","service":"","units":"","sale":false,"amount":10,"buy":true,"taxCode":""},"qtty":10,"notes":"","contractItemId":"test"}],"title":"test","vendor":{"id":299503,"registeredId":"121"},"attrs":{"{String}":""},"forms":{},"endDate":14,"contractId":0,"type":"","logo":"","postingTriggeredAt":0,"postingErrors":"","postingDocNo":"","postingTriggered":false,"postingFailed":false,"po_no":"1212121212"}}'
};

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

```go Purchase Orders(PO)_Create PO API_example
package main

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

func main() {

	url := "https://heimdall.eka.io/apis/external/po/create"

	payload := strings.NewReader("{\n  \"data\": {\n    \"owner\": {\n      \"ownerName\": \"test\",\n      \"ownerEmail\": \"test\"\n    },\n    \"currency\": \"INR\",\n    \"superId\": 12,\n    \"billTo\": {\n      \"name\": \"test\",\n      \"value\": 1\n    },\n    \"shipTo\": {\n      \"name\": \"test2\",\n      \"value\": 1\n    },\n    \"category\": {\n      \"id\": 1,\n      \"label\": \"test\"\n    },\n    \"deliveryDate\": 12,\n    \"list\": [\n      {\n        \"base\": 10,\n        \"product\": {\n          \"label\": \"test\",\n          \"value\": 10,\n          \"itemReferenceNo\": \"\",\n          \"isMaster\": false,\n          \"productId\": \"test\",\n          \"gl\": \"\",\n          \"image\": \"\",\n          \"title\": \"\",\n          \"desc\": \"\",\n          \"currency\": \"INR\",\n          \"hsn\": \"\",\n          \"sku\": \"\",\n          \"type\": \"\",\n          \"service\": \"\",\n          \"units\": \"\",\n          \"sale\": false,\n          \"amount\": 10,\n          \"buy\": true,\n          \"taxCode\": \"\"\n        },\n        \"qtty\": 10,\n        \"notes\": \"\",\n        \"contractItemId\": \"test\"\n      }\n    ],\n    \"title\": \"test\",\n    \"vendor\": {\n      \"id\": 299503,\n      \"registeredId\": \"121\"\n    },\n    \"attrs\": {\n      \"{String}\": \"\"\n    },\n    \"forms\": {},\n    \"endDate\": 14,\n    \"contractId\": 0,\n    \"type\": \"\",\n    \"logo\": \"\",\n    \"postingTriggeredAt\": 0,\n    \"postingErrors\": \"\",\n    \"postingDocNo\": \"\",\n    \"postingTriggered\": false,\n    \"postingFailed\": false,\n    \"po_no\": \"1212121212\"\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 Purchase Orders(PO)_Create PO API_example
require 'uri'
require 'net/http'

url = URI("https://heimdall.eka.io/apis/external/po/create")

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  \"data\": {\n    \"owner\": {\n      \"ownerName\": \"test\",\n      \"ownerEmail\": \"test\"\n    },\n    \"currency\": \"INR\",\n    \"superId\": 12,\n    \"billTo\": {\n      \"name\": \"test\",\n      \"value\": 1\n    },\n    \"shipTo\": {\n      \"name\": \"test2\",\n      \"value\": 1\n    },\n    \"category\": {\n      \"id\": 1,\n      \"label\": \"test\"\n    },\n    \"deliveryDate\": 12,\n    \"list\": [\n      {\n        \"base\": 10,\n        \"product\": {\n          \"label\": \"test\",\n          \"value\": 10,\n          \"itemReferenceNo\": \"\",\n          \"isMaster\": false,\n          \"productId\": \"test\",\n          \"gl\": \"\",\n          \"image\": \"\",\n          \"title\": \"\",\n          \"desc\": \"\",\n          \"currency\": \"INR\",\n          \"hsn\": \"\",\n          \"sku\": \"\",\n          \"type\": \"\",\n          \"service\": \"\",\n          \"units\": \"\",\n          \"sale\": false,\n          \"amount\": 10,\n          \"buy\": true,\n          \"taxCode\": \"\"\n        },\n        \"qtty\": 10,\n        \"notes\": \"\",\n        \"contractItemId\": \"test\"\n      }\n    ],\n    \"title\": \"test\",\n    \"vendor\": {\n      \"id\": 299503,\n      \"registeredId\": \"121\"\n    },\n    \"attrs\": {\n      \"{String}\": \"\"\n    },\n    \"forms\": {},\n    \"endDate\": 14,\n    \"contractId\": 0,\n    \"type\": \"\",\n    \"logo\": \"\",\n    \"postingTriggeredAt\": 0,\n    \"postingErrors\": \"\",\n    \"postingDocNo\": \"\",\n    \"postingTriggered\": false,\n    \"postingFailed\": false,\n    \"po_no\": \"1212121212\"\n  }\n}"

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

```java Purchase Orders(PO)_Create PO API_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://heimdall.eka.io/apis/external/po/create")
  .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  \"data\": {\n    \"owner\": {\n      \"ownerName\": \"test\",\n      \"ownerEmail\": \"test\"\n    },\n    \"currency\": \"INR\",\n    \"superId\": 12,\n    \"billTo\": {\n      \"name\": \"test\",\n      \"value\": 1\n    },\n    \"shipTo\": {\n      \"name\": \"test2\",\n      \"value\": 1\n    },\n    \"category\": {\n      \"id\": 1,\n      \"label\": \"test\"\n    },\n    \"deliveryDate\": 12,\n    \"list\": [\n      {\n        \"base\": 10,\n        \"product\": {\n          \"label\": \"test\",\n          \"value\": 10,\n          \"itemReferenceNo\": \"\",\n          \"isMaster\": false,\n          \"productId\": \"test\",\n          \"gl\": \"\",\n          \"image\": \"\",\n          \"title\": \"\",\n          \"desc\": \"\",\n          \"currency\": \"INR\",\n          \"hsn\": \"\",\n          \"sku\": \"\",\n          \"type\": \"\",\n          \"service\": \"\",\n          \"units\": \"\",\n          \"sale\": false,\n          \"amount\": 10,\n          \"buy\": true,\n          \"taxCode\": \"\"\n        },\n        \"qtty\": 10,\n        \"notes\": \"\",\n        \"contractItemId\": \"test\"\n      }\n    ],\n    \"title\": \"test\",\n    \"vendor\": {\n      \"id\": 299503,\n      \"registeredId\": \"121\"\n    },\n    \"attrs\": {\n      \"{String}\": \"\"\n    },\n    \"forms\": {},\n    \"endDate\": 14,\n    \"contractId\": 0,\n    \"type\": \"\",\n    \"logo\": \"\",\n    \"postingTriggeredAt\": 0,\n    \"postingErrors\": \"\",\n    \"postingDocNo\": \"\",\n    \"postingTriggered\": false,\n    \"postingFailed\": false,\n    \"po_no\": \"1212121212\"\n  }\n}")
  .asString();
```

```php Purchase Orders(PO)_Create PO API_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://heimdall.eka.io/apis/external/po/create', [
  'body' => '{
  "data": {
    "owner": {
      "ownerName": "test",
      "ownerEmail": "test"
    },
    "currency": "INR",
    "superId": 12,
    "billTo": {
      "name": "test",
      "value": 1
    },
    "shipTo": {
      "name": "test2",
      "value": 1
    },
    "category": {
      "id": 1,
      "label": "test"
    },
    "deliveryDate": 12,
    "list": [
      {
        "base": 10,
        "product": {
          "label": "test",
          "value": 10,
          "itemReferenceNo": "",
          "isMaster": false,
          "productId": "test",
          "gl": "",
          "image": "",
          "title": "",
          "desc": "",
          "currency": "INR",
          "hsn": "",
          "sku": "",
          "type": "",
          "service": "",
          "units": "",
          "sale": false,
          "amount": 10,
          "buy": true,
          "taxCode": ""
        },
        "qtty": 10,
        "notes": "",
        "contractItemId": "test"
      }
    ],
    "title": "test",
    "vendor": {
      "id": 299503,
      "registeredId": "121"
    },
    "attrs": {
      "{String}": ""
    },
    "forms": {},
    "endDate": 14,
    "contractId": 0,
    "type": "",
    "logo": "",
    "postingTriggeredAt": 0,
    "postingErrors": "",
    "postingDocNo": "",
    "postingTriggered": false,
    "postingFailed": false,
    "po_no": "1212121212"
  }
}',
  '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 Purchase Orders(PO)_Create PO API_example
using RestSharp;

var client = new RestClient("https://heimdall.eka.io/apis/external/po/create");
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  \"data\": {\n    \"owner\": {\n      \"ownerName\": \"test\",\n      \"ownerEmail\": \"test\"\n    },\n    \"currency\": \"INR\",\n    \"superId\": 12,\n    \"billTo\": {\n      \"name\": \"test\",\n      \"value\": 1\n    },\n    \"shipTo\": {\n      \"name\": \"test2\",\n      \"value\": 1\n    },\n    \"category\": {\n      \"id\": 1,\n      \"label\": \"test\"\n    },\n    \"deliveryDate\": 12,\n    \"list\": [\n      {\n        \"base\": 10,\n        \"product\": {\n          \"label\": \"test\",\n          \"value\": 10,\n          \"itemReferenceNo\": \"\",\n          \"isMaster\": false,\n          \"productId\": \"test\",\n          \"gl\": \"\",\n          \"image\": \"\",\n          \"title\": \"\",\n          \"desc\": \"\",\n          \"currency\": \"INR\",\n          \"hsn\": \"\",\n          \"sku\": \"\",\n          \"type\": \"\",\n          \"service\": \"\",\n          \"units\": \"\",\n          \"sale\": false,\n          \"amount\": 10,\n          \"buy\": true,\n          \"taxCode\": \"\"\n        },\n        \"qtty\": 10,\n        \"notes\": \"\",\n        \"contractItemId\": \"test\"\n      }\n    ],\n    \"title\": \"test\",\n    \"vendor\": {\n      \"id\": 299503,\n      \"registeredId\": \"121\"\n    },\n    \"attrs\": {\n      \"{String}\": \"\"\n    },\n    \"forms\": {},\n    \"endDate\": 14,\n    \"contractId\": 0,\n    \"type\": \"\",\n    \"logo\": \"\",\n    \"postingTriggeredAt\": 0,\n    \"postingErrors\": \"\",\n    \"postingDocNo\": \"\",\n    \"postingTriggered\": false,\n    \"postingFailed\": false,\n    \"po_no\": \"1212121212\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Purchase Orders(PO)_Create PO API_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 = ["data": [
    "owner": [
      "ownerName": "test",
      "ownerEmail": "test"
    ],
    "currency": "INR",
    "superId": 12,
    "billTo": [
      "name": "test",
      "value": 1
    ],
    "shipTo": [
      "name": "test2",
      "value": 1
    ],
    "category": [
      "id": 1,
      "label": "test"
    ],
    "deliveryDate": 12,
    "list": [
      [
        "base": 10,
        "product": [
          "label": "test",
          "value": 10,
          "itemReferenceNo": "",
          "isMaster": false,
          "productId": "test",
          "gl": "",
          "image": "",
          "title": "",
          "desc": "",
          "currency": "INR",
          "hsn": "",
          "sku": "",
          "type": "",
          "service": "",
          "units": "",
          "sale": false,
          "amount": 10,
          "buy": true,
          "taxCode": ""
        ],
        "qtty": 10,
        "notes": "",
        "contractItemId": "test"
      ]
    ],
    "title": "test",
    "vendor": [
      "id": 299503,
      "registeredId": "121"
    ],
    "attrs": ["{String}": ""],
    "forms": [],
    "endDate": 14,
    "contractId": 0,
    "type": "",
    "logo": "",
    "postingTriggeredAt": 0,
    "postingErrors": "",
    "postingDocNo": "",
    "postingTriggered": false,
    "postingFailed": false,
    "po_no": "1212121212"
  ]] as [String : Any]

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

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