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

# Create Purchase Order

POST https://connect.plex.com/purchasing/v1/purchase-orders
Content-Type: application/json

Creates a new purchase order in the system. A purchase order represents an agreement to purchase goods or services from a supplier.

Reference: https://rockwell.ferndocs.com/api-reference/purchase-orders-api/create-purchase-order

## Request

### Body (application/json)

This endpoint expects an object.

- `supplierNo` (string, optional)
- `supplierId` (string, optional)
- `supplierCode` (string, optional)
- `supplierAddressCode` (string, optional)
- `terms` (string, optional)
- `periodDisplay` (string, optional)
- `currencyCode` (string, optional)
- `status` (string, optional)
- `discountDate` (datetime, optional)
- `poId` (string, optional)
- `note` (string, optional)
- `checkMemo` (string, optional)
- `buyerName` (string, optional)
- `invoiceDate` (datetime, optional)
- `poNumber` (string, optional)
- `dueDate` (datetime, optional)
- `department` (string, optional)
- `exchangeRate` (double, optional)
- `debitMemo` (boolean, optional)
- `governmentIssueNumber` (string, optional)
- `discount` (double, optional)
- `interCompany` (boolean, optional)
- `discountableAmount` (double, optional)
- `expectedPayDate` (datetime, optional)
- `taxIdentificationNumber` (string, optional)
- `type` (string, optional)
- `lines` (list of PurchasingV1PurchaseOrdersPostRequestBodyContentApplicationJsonSchemaLinesItems, optional)

## Response

### 201

Created

- `id` (string, optional)
- `poNumber` (string, optional)
- `supplierNo` (string, optional)
- `supplierId` (string, optional)
- `supplierCode` (string, optional)
- `supplierAddressCode` (string, optional)
- `terms` (string, optional)
- `currencyCode` (string, optional)
- `status` (string, optional)
- `exchangeRate` (integer, optional)
- `createdDate` (datetime, optional)
- `createdBy` (string, optional)
- `totalAmount` (integer, optional)
- `lines` (list of any, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `error` (PurchasingV1PurchaseOrdersPostResponsesContentApplicationJsonSchemaError, optional)

## Types

### PurchasingV1PurchaseOrdersPostRequestBodyContentApplicationJsonSchemaLinesItems

- `accountId` (string, optional)
- `accountNumber` (string, optional)
- `description` (string, optional)
- `extendedAmount` (double, optional)
- `jobNo` (double, optional)
- `partNo` (string, optional)
- `partKey` (string, optional)
- `periodYear` (integer, optional)
- `quantity` (double, optional)
- `rate` (double, optional)
- `requisitionNo` (double, optional)
- `taxCode` (string, optional)
- `projectCode` (string, optional)
- `subContractNo` (string, optional)
- `department` (string, optional)
- `refSubAccount` (string, optional)
- `projectNo` (string, optional)
- `action` (string, optional)
- `poNumber` (string, optional)
- `unit` (string, optional)
- `classId` (list of string, optional)
- `locationId` (string, optional)
- `forecastDate` (string, optional)
- `projectId` (string, optional)
- `autoRelease` (double, optional)
- `costType` (string, optional)
- `uoM` (string, optional)

### PurchasingV1PurchaseOrdersPostResponsesContentApplicationJsonSchemaError

- `code` (string, optional)
- `message` (string, optional)
- `details` (list of PurchasingV1PurchaseOrdersPostResponsesContentApplicationJsonSchemaErrorDetailsItems, optional)

### PurchasingV1PurchaseOrdersPostResponsesContentApplicationJsonSchemaErrorDetailsItems

- `field` (string, optional)
- `message` (string, optional)

## Examples

**Request**

```json
{
  "supplierNo": "00000000-0000-0000-0000-000000000000",
  "supplierId": "00000000-0000-0000-0000-000000000000",
  "supplierCode": "string",
  "supplierAddressCode": "string",
  "terms": "string",
  "periodDisplay": "string",
  "currencyCode": "string",
  "status": "string",
  "discountDate": "2026-02-10T19:58:00Z",
  "poId": "00000000-0000-0000-0000-000000000000",
  "note": "string",
  "checkMemo": "string",
  "buyerName": "string",
  "invoiceDate": "2026-02-10T19:58:00Z",
  "poNumber": "string",
  "dueDate": "2026-02-10T19:58:00Z",
  "department": "string",
  "exchangeRate": 0.1,
  "debitMemo": false,
  "governmentIssueNumber": "string",
  "discount": 0.1,
  "interCompany": false,
  "discountableAmount": 0.1,
  "expectedPayDate": "2026-02-10T19:58:00Z",
  "taxIdentificationNumber": "string",
  "type": "string",
  "lines": [
    {
      "accountId": "00000000-0000-0000-0000-000000000000",
      "accountNumber": "string",
      "description": "string",
      "extendedAmount": 0.1,
      "jobNo": 0.1,
      "partNo": "string",
      "partKey": "2026-07-07T9:10:36.00Z",
      "periodYear": 0,
      "quantity": 0.1,
      "rate": 0.1,
      "requisitionNo": 0.1,
      "taxCode": "string",
      "projectCode": "string",
      "subContractNo": "string",
      "department": "string",
      "refSubAccount": "string",
      "projectNo": "string",
      "action": "string",
      "poNumber": "string",
      "unit": "string",
      "classId": [
        "..."
      ],
      "locationId": "00000000-0000-0000-0000-000000000000",
      "forecastDate": "string",
      "projectId": "00000000-0000-0000-0000-000000000000",
      "autoRelease": 0.1,
      "costType": "string",
      "uoM": "string"
    }
  ]
}
```

**Response**

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "poNumber": "PO-2026-001234",
  "supplierNo": "00000000-0000-0000-0000-000000000000",
  "supplierId": "SUP-001",
  "supplierCode": "ACME-CORP",
  "supplierAddressCode": "MAIN",
  "terms": "Net 30",
  "currencyCode": "USD",
  "status": "Open",
  "exchangeRate": 1,
  "createdDate": "2026-02-10T19:58:00.00Z",
  "createdBy": "user@example.com",
  "totalAmount": 0,
  "lines": []
}
```

**SDK Code**

```python createPurchaseOrder_example
import requests

url = "https://connect.plex.com/purchasing/v1/purchase-orders"

payload = {
    "supplierNo": "00000000-0000-0000-0000-000000000000",
    "supplierId": "00000000-0000-0000-0000-000000000000",
    "supplierCode": "string",
    "supplierAddressCode": "string",
    "terms": "string",
    "periodDisplay": "string",
    "currencyCode": "string",
    "status": "string",
    "discountDate": "2026-02-10T19:58:00Z",
    "poId": "00000000-0000-0000-0000-000000000000",
    "note": "string",
    "checkMemo": "string",
    "buyerName": "string",
    "invoiceDate": "2026-02-10T19:58:00Z",
    "poNumber": "string",
    "dueDate": "2026-02-10T19:58:00Z",
    "department": "string",
    "exchangeRate": 0.1,
    "debitMemo": False,
    "governmentIssueNumber": "string",
    "discount": 0.1,
    "interCompany": False,
    "discountableAmount": 0.1,
    "expectedPayDate": "2026-02-10T19:58:00Z",
    "taxIdentificationNumber": "string",
    "type": "string",
    "lines": [
        {
            "accountId": "00000000-0000-0000-0000-000000000000",
            "accountNumber": "string",
            "description": "string",
            "extendedAmount": 0.1,
            "jobNo": 0.1,
            "partNo": "string",
            "partKey": "2026-07-07T9:10:36.00Z",
            "periodYear": 0,
            "quantity": 0.1,
            "rate": 0.1,
            "requisitionNo": 0.1,
            "taxCode": "string",
            "projectCode": "string",
            "subContractNo": "string",
            "department": "string",
            "refSubAccount": "string",
            "projectNo": "string",
            "action": "string",
            "poNumber": "string",
            "unit": "string",
            "classId": ["..."],
            "locationId": "00000000-0000-0000-0000-000000000000",
            "forecastDate": "string",
            "projectId": "00000000-0000-0000-0000-000000000000",
            "autoRelease": 0.1,
            "costType": "string",
            "uoM": "string"
        }
    ]
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript createPurchaseOrder_example
const url = 'https://connect.plex.com/purchasing/v1/purchase-orders';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"supplierNo":"00000000-0000-0000-0000-000000000000","supplierId":"00000000-0000-0000-0000-000000000000","supplierCode":"string","supplierAddressCode":"string","terms":"string","periodDisplay":"string","currencyCode":"string","status":"string","discountDate":"2026-02-10T19:58:00Z","poId":"00000000-0000-0000-0000-000000000000","note":"string","checkMemo":"string","buyerName":"string","invoiceDate":"2026-02-10T19:58:00Z","poNumber":"string","dueDate":"2026-02-10T19:58:00Z","department":"string","exchangeRate":0.1,"debitMemo":false,"governmentIssueNumber":"string","discount":0.1,"interCompany":false,"discountableAmount":0.1,"expectedPayDate":"2026-02-10T19:58:00Z","taxIdentificationNumber":"string","type":"string","lines":[{"accountId":"00000000-0000-0000-0000-000000000000","accountNumber":"string","description":"string","extendedAmount":0.1,"jobNo":0.1,"partNo":"string","partKey":"2026-07-07T9:10:36.00Z","periodYear":0,"quantity":0.1,"rate":0.1,"requisitionNo":0.1,"taxCode":"string","projectCode":"string","subContractNo":"string","department":"string","refSubAccount":"string","projectNo":"string","action":"string","poNumber":"string","unit":"string","classId":["..."],"locationId":"00000000-0000-0000-0000-000000000000","forecastDate":"string","projectId":"00000000-0000-0000-0000-000000000000","autoRelease":0.1,"costType":"string","uoM":"string"}]}'
};

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

```go createPurchaseOrder_example
package main

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

func main() {

	url := "https://connect.plex.com/purchasing/v1/purchase-orders"

	payload := strings.NewReader("{\n  \"supplierNo\": \"00000000-0000-0000-0000-000000000000\",\n  \"supplierId\": \"00000000-0000-0000-0000-000000000000\",\n  \"supplierCode\": \"string\",\n  \"supplierAddressCode\": \"string\",\n  \"terms\": \"string\",\n  \"periodDisplay\": \"string\",\n  \"currencyCode\": \"string\",\n  \"status\": \"string\",\n  \"discountDate\": \"2026-02-10T19:58:00Z\",\n  \"poId\": \"00000000-0000-0000-0000-000000000000\",\n  \"note\": \"string\",\n  \"checkMemo\": \"string\",\n  \"buyerName\": \"string\",\n  \"invoiceDate\": \"2026-02-10T19:58:00Z\",\n  \"poNumber\": \"string\",\n  \"dueDate\": \"2026-02-10T19:58:00Z\",\n  \"department\": \"string\",\n  \"exchangeRate\": 0.1,\n  \"debitMemo\": false,\n  \"governmentIssueNumber\": \"string\",\n  \"discount\": 0.1,\n  \"interCompany\": false,\n  \"discountableAmount\": 0.1,\n  \"expectedPayDate\": \"2026-02-10T19:58:00Z\",\n  \"taxIdentificationNumber\": \"string\",\n  \"type\": \"string\",\n  \"lines\": [\n    {\n      \"accountId\": \"00000000-0000-0000-0000-000000000000\",\n      \"accountNumber\": \"string\",\n      \"description\": \"string\",\n      \"extendedAmount\": 0.1,\n      \"jobNo\": 0.1,\n      \"partNo\": \"string\",\n      \"partKey\": \"2026-07-07T9:10:36.00Z\",\n      \"periodYear\": 0,\n      \"quantity\": 0.1,\n      \"rate\": 0.1,\n      \"requisitionNo\": 0.1,\n      \"taxCode\": \"string\",\n      \"projectCode\": \"string\",\n      \"subContractNo\": \"string\",\n      \"department\": \"string\",\n      \"refSubAccount\": \"string\",\n      \"projectNo\": \"string\",\n      \"action\": \"string\",\n      \"poNumber\": \"string\",\n      \"unit\": \"string\",\n      \"classId\": [\n        \"...\"\n      ],\n      \"locationId\": \"00000000-0000-0000-0000-000000000000\",\n      \"forecastDate\": \"string\",\n      \"projectId\": \"00000000-0000-0000-0000-000000000000\",\n      \"autoRelease\": 0.1,\n      \"costType\": \"string\",\n      \"uoM\": \"string\"\n    }\n  ]\n}")

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

	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 createPurchaseOrder_example
require 'uri'
require 'net/http'

url = URI("https://connect.plex.com/purchasing/v1/purchase-orders")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"supplierNo\": \"00000000-0000-0000-0000-000000000000\",\n  \"supplierId\": \"00000000-0000-0000-0000-000000000000\",\n  \"supplierCode\": \"string\",\n  \"supplierAddressCode\": \"string\",\n  \"terms\": \"string\",\n  \"periodDisplay\": \"string\",\n  \"currencyCode\": \"string\",\n  \"status\": \"string\",\n  \"discountDate\": \"2026-02-10T19:58:00Z\",\n  \"poId\": \"00000000-0000-0000-0000-000000000000\",\n  \"note\": \"string\",\n  \"checkMemo\": \"string\",\n  \"buyerName\": \"string\",\n  \"invoiceDate\": \"2026-02-10T19:58:00Z\",\n  \"poNumber\": \"string\",\n  \"dueDate\": \"2026-02-10T19:58:00Z\",\n  \"department\": \"string\",\n  \"exchangeRate\": 0.1,\n  \"debitMemo\": false,\n  \"governmentIssueNumber\": \"string\",\n  \"discount\": 0.1,\n  \"interCompany\": false,\n  \"discountableAmount\": 0.1,\n  \"expectedPayDate\": \"2026-02-10T19:58:00Z\",\n  \"taxIdentificationNumber\": \"string\",\n  \"type\": \"string\",\n  \"lines\": [\n    {\n      \"accountId\": \"00000000-0000-0000-0000-000000000000\",\n      \"accountNumber\": \"string\",\n      \"description\": \"string\",\n      \"extendedAmount\": 0.1,\n      \"jobNo\": 0.1,\n      \"partNo\": \"string\",\n      \"partKey\": \"2026-07-07T9:10:36.00Z\",\n      \"periodYear\": 0,\n      \"quantity\": 0.1,\n      \"rate\": 0.1,\n      \"requisitionNo\": 0.1,\n      \"taxCode\": \"string\",\n      \"projectCode\": \"string\",\n      \"subContractNo\": \"string\",\n      \"department\": \"string\",\n      \"refSubAccount\": \"string\",\n      \"projectNo\": \"string\",\n      \"action\": \"string\",\n      \"poNumber\": \"string\",\n      \"unit\": \"string\",\n      \"classId\": [\n        \"...\"\n      ],\n      \"locationId\": \"00000000-0000-0000-0000-000000000000\",\n      \"forecastDate\": \"string\",\n      \"projectId\": \"00000000-0000-0000-0000-000000000000\",\n      \"autoRelease\": 0.1,\n      \"costType\": \"string\",\n      \"uoM\": \"string\"\n    }\n  ]\n}"

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

```java createPurchaseOrder_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://connect.plex.com/purchasing/v1/purchase-orders")
  .header("Content-Type", "application/json")
  .body("{\n  \"supplierNo\": \"00000000-0000-0000-0000-000000000000\",\n  \"supplierId\": \"00000000-0000-0000-0000-000000000000\",\n  \"supplierCode\": \"string\",\n  \"supplierAddressCode\": \"string\",\n  \"terms\": \"string\",\n  \"periodDisplay\": \"string\",\n  \"currencyCode\": \"string\",\n  \"status\": \"string\",\n  \"discountDate\": \"2026-02-10T19:58:00Z\",\n  \"poId\": \"00000000-0000-0000-0000-000000000000\",\n  \"note\": \"string\",\n  \"checkMemo\": \"string\",\n  \"buyerName\": \"string\",\n  \"invoiceDate\": \"2026-02-10T19:58:00Z\",\n  \"poNumber\": \"string\",\n  \"dueDate\": \"2026-02-10T19:58:00Z\",\n  \"department\": \"string\",\n  \"exchangeRate\": 0.1,\n  \"debitMemo\": false,\n  \"governmentIssueNumber\": \"string\",\n  \"discount\": 0.1,\n  \"interCompany\": false,\n  \"discountableAmount\": 0.1,\n  \"expectedPayDate\": \"2026-02-10T19:58:00Z\",\n  \"taxIdentificationNumber\": \"string\",\n  \"type\": \"string\",\n  \"lines\": [\n    {\n      \"accountId\": \"00000000-0000-0000-0000-000000000000\",\n      \"accountNumber\": \"string\",\n      \"description\": \"string\",\n      \"extendedAmount\": 0.1,\n      \"jobNo\": 0.1,\n      \"partNo\": \"string\",\n      \"partKey\": \"2026-07-07T9:10:36.00Z\",\n      \"periodYear\": 0,\n      \"quantity\": 0.1,\n      \"rate\": 0.1,\n      \"requisitionNo\": 0.1,\n      \"taxCode\": \"string\",\n      \"projectCode\": \"string\",\n      \"subContractNo\": \"string\",\n      \"department\": \"string\",\n      \"refSubAccount\": \"string\",\n      \"projectNo\": \"string\",\n      \"action\": \"string\",\n      \"poNumber\": \"string\",\n      \"unit\": \"string\",\n      \"classId\": [\n        \"...\"\n      ],\n      \"locationId\": \"00000000-0000-0000-0000-000000000000\",\n      \"forecastDate\": \"string\",\n      \"projectId\": \"00000000-0000-0000-0000-000000000000\",\n      \"autoRelease\": 0.1,\n      \"costType\": \"string\",\n      \"uoM\": \"string\"\n    }\n  ]\n}")
  .asString();
```

```php createPurchaseOrder_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://connect.plex.com/purchasing/v1/purchase-orders', [
  'body' => '{
  "supplierNo": "00000000-0000-0000-0000-000000000000",
  "supplierId": "00000000-0000-0000-0000-000000000000",
  "supplierCode": "string",
  "supplierAddressCode": "string",
  "terms": "string",
  "periodDisplay": "string",
  "currencyCode": "string",
  "status": "string",
  "discountDate": "2026-02-10T19:58:00Z",
  "poId": "00000000-0000-0000-0000-000000000000",
  "note": "string",
  "checkMemo": "string",
  "buyerName": "string",
  "invoiceDate": "2026-02-10T19:58:00Z",
  "poNumber": "string",
  "dueDate": "2026-02-10T19:58:00Z",
  "department": "string",
  "exchangeRate": 0.1,
  "debitMemo": false,
  "governmentIssueNumber": "string",
  "discount": 0.1,
  "interCompany": false,
  "discountableAmount": 0.1,
  "expectedPayDate": "2026-02-10T19:58:00Z",
  "taxIdentificationNumber": "string",
  "type": "string",
  "lines": [
    {
      "accountId": "00000000-0000-0000-0000-000000000000",
      "accountNumber": "string",
      "description": "string",
      "extendedAmount": 0.1,
      "jobNo": 0.1,
      "partNo": "string",
      "partKey": "2026-07-07T9:10:36.00Z",
      "periodYear": 0,
      "quantity": 0.1,
      "rate": 0.1,
      "requisitionNo": 0.1,
      "taxCode": "string",
      "projectCode": "string",
      "subContractNo": "string",
      "department": "string",
      "refSubAccount": "string",
      "projectNo": "string",
      "action": "string",
      "poNumber": "string",
      "unit": "string",
      "classId": [
        "..."
      ],
      "locationId": "00000000-0000-0000-0000-000000000000",
      "forecastDate": "string",
      "projectId": "00000000-0000-0000-0000-000000000000",
      "autoRelease": 0.1,
      "costType": "string",
      "uoM": "string"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp createPurchaseOrder_example
using RestSharp;

var client = new RestClient("https://connect.plex.com/purchasing/v1/purchase-orders");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"supplierNo\": \"00000000-0000-0000-0000-000000000000\",\n  \"supplierId\": \"00000000-0000-0000-0000-000000000000\",\n  \"supplierCode\": \"string\",\n  \"supplierAddressCode\": \"string\",\n  \"terms\": \"string\",\n  \"periodDisplay\": \"string\",\n  \"currencyCode\": \"string\",\n  \"status\": \"string\",\n  \"discountDate\": \"2026-02-10T19:58:00Z\",\n  \"poId\": \"00000000-0000-0000-0000-000000000000\",\n  \"note\": \"string\",\n  \"checkMemo\": \"string\",\n  \"buyerName\": \"string\",\n  \"invoiceDate\": \"2026-02-10T19:58:00Z\",\n  \"poNumber\": \"string\",\n  \"dueDate\": \"2026-02-10T19:58:00Z\",\n  \"department\": \"string\",\n  \"exchangeRate\": 0.1,\n  \"debitMemo\": false,\n  \"governmentIssueNumber\": \"string\",\n  \"discount\": 0.1,\n  \"interCompany\": false,\n  \"discountableAmount\": 0.1,\n  \"expectedPayDate\": \"2026-02-10T19:58:00Z\",\n  \"taxIdentificationNumber\": \"string\",\n  \"type\": \"string\",\n  \"lines\": [\n    {\n      \"accountId\": \"00000000-0000-0000-0000-000000000000\",\n      \"accountNumber\": \"string\",\n      \"description\": \"string\",\n      \"extendedAmount\": 0.1,\n      \"jobNo\": 0.1,\n      \"partNo\": \"string\",\n      \"partKey\": \"2026-07-07T9:10:36.00Z\",\n      \"periodYear\": 0,\n      \"quantity\": 0.1,\n      \"rate\": 0.1,\n      \"requisitionNo\": 0.1,\n      \"taxCode\": \"string\",\n      \"projectCode\": \"string\",\n      \"subContractNo\": \"string\",\n      \"department\": \"string\",\n      \"refSubAccount\": \"string\",\n      \"projectNo\": \"string\",\n      \"action\": \"string\",\n      \"poNumber\": \"string\",\n      \"unit\": \"string\",\n      \"classId\": [\n        \"...\"\n      ],\n      \"locationId\": \"00000000-0000-0000-0000-000000000000\",\n      \"forecastDate\": \"string\",\n      \"projectId\": \"00000000-0000-0000-0000-000000000000\",\n      \"autoRelease\": 0.1,\n      \"costType\": \"string\",\n      \"uoM\": \"string\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift createPurchaseOrder_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "supplierNo": "00000000-0000-0000-0000-000000000000",
  "supplierId": "00000000-0000-0000-0000-000000000000",
  "supplierCode": "string",
  "supplierAddressCode": "string",
  "terms": "string",
  "periodDisplay": "string",
  "currencyCode": "string",
  "status": "string",
  "discountDate": "2026-02-10T19:58:00Z",
  "poId": "00000000-0000-0000-0000-000000000000",
  "note": "string",
  "checkMemo": "string",
  "buyerName": "string",
  "invoiceDate": "2026-02-10T19:58:00Z",
  "poNumber": "string",
  "dueDate": "2026-02-10T19:58:00Z",
  "department": "string",
  "exchangeRate": 0.1,
  "debitMemo": false,
  "governmentIssueNumber": "string",
  "discount": 0.1,
  "interCompany": false,
  "discountableAmount": 0.1,
  "expectedPayDate": "2026-02-10T19:58:00Z",
  "taxIdentificationNumber": "string",
  "type": "string",
  "lines": [
    [
      "accountId": "00000000-0000-0000-0000-000000000000",
      "accountNumber": "string",
      "description": "string",
      "extendedAmount": 0.1,
      "jobNo": 0.1,
      "partNo": "string",
      "partKey": "2026-07-07T9:10:36.00Z",
      "periodYear": 0,
      "quantity": 0.1,
      "rate": 0.1,
      "requisitionNo": 0.1,
      "taxCode": "string",
      "projectCode": "string",
      "subContractNo": "string",
      "department": "string",
      "refSubAccount": "string",
      "projectNo": "string",
      "action": "string",
      "poNumber": "string",
      "unit": "string",
      "classId": ["..."],
      "locationId": "00000000-0000-0000-0000-000000000000",
      "forecastDate": "string",
      "projectId": "00000000-0000-0000-0000-000000000000",
      "autoRelease": 0.1,
      "costType": "string",
      "uoM": "string"
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://connect.plex.com/purchasing/v1/purchase-orders")! 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()
```