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

# Create a purchase order

POST https://api.propexo.com/v1/purchase-orders/
Content-Type: application/json

Create a purchase order for an integration.

Reference: https://docs.propexo.com/api-reference/pms-generic-ap-is/purchase-orders/create-a-purchase-order

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.propexo.com` (Production, default)
- `https://api.sandbox.propexo.com` (Sandbox)

## Request

### Body (application/json)

This endpoint expects a _v1_purchase-orders__post_input.

- `integration_id` (string, required)
- `vendor_id` (string, optional) — The Propexo unique identifier for the vendor
- `vendor_location_id` (string, optional) — The Propexo unique identifier for the vendor location
- `property_id` (string, optional) — The Propexo unique identifier for the property
- `ap_financial_account_id` (string, optional) — The Propexo unique identifier for the financial account. You'll likely want to work with your customer to know what value is appropriate here.
- `post_date` (V1PurchaseOrdersPostInputPostDate, optional) — The post date for the purchase order
- `description` (string, optional) — Description of the purchase order
- `shipping_amount_in_cents` (integer, optional) — The cost of shipping, in cents, of the purchase order
- `discount_amount_in_cents` (integer, optional) — The discount, in cents, of the purchase order
- `purchase_order_items` (list of V1PurchaseOrdersPostInputPurchaseOrderItemsItems, optional) — A list of the items associated with the purchase orders
- `location_id` (string, optional) — The Propexo unique identifier for the location
- `employee_id` (string, optional) — The Propexo unique identifier for the employee. Recorded as the requesting user on the purchase order
- `number` (string, optional) — The number of the purchase order
- `order_date` (V1PurchaseOrdersPostInputOrderDate, optional) — The order date for the purchase order
- `total_amount_in_cents` (double, optional) — The amount of the purchase order, in cents
- `shipping_address_1` (string, optional) — The first address line associated with the shipping address for the purchase order
- `billing_address_1` (string, optional) — The first address line associated with the billing address for the purchase order
- `expense_type` (string, optional) — The expense type of the purchase order. You'll have to request this data from your customer
- `display_type` (string, optional) — The display type of the purchase order. You'll have to request this data from your customer
- `shipping_address_2` (string, optional) — The second address line associated with the shipping address for the purchase order
- `shipping_city` (string, optional) — The city associated with the shipping address for the purchase order
- `shipping_state` (V1PurchaseOrdersPostInputShippingState, optional) — The state associated with the shipping address for the purchase order. This must be a state abbreviation
- `shipping_zip` (string, optional) — The zip code associated with the shipping address for the purchase order
- `shipping_country` (string, optional) — The country associated with the shipping address for the purchase order
- `billing_address_2` (string, optional) — The second address line associated with the billing address for the purchase order
- `billing_city` (string, optional) — The city associated with the billing address for the purchase order
- `billing_state` (V1PurchaseOrdersPostInputBillingState, optional) — The state associated with the billing address for the purchase order. This must be a state abbreviation
- `billing_zip` (string, optional) — The zip code associated with the billing address for the purchase order
- `billing_country` (string, optional) — The country associated with the billing address for the purchase order

## Response

### 200

Successful response

- `job_id` (string, required) — The ID of the job created to handle this operation
- `data` (V1PurchaseOrdersPostOutputData, required)

## Errors

### 400 Bad Request Error

Bad Request

- `error` (ErrorResponseError, required)

## Types

### V1PurchaseOrdersPostInputPostDate

The post date for the purchase order

### V1PurchaseOrdersPostInputPurchaseOrderItemsItems

### V1PurchaseOrdersPostInputOrderDate

The order date for the purchase order

### V1PurchaseOrdersPostInputShippingState

The state associated with the shipping address for the purchase order. This must be a state abbreviation

### V1PurchaseOrdersPostInputBillingState

The state associated with the billing address for the purchase order. This must be a state abbreviation

### V1PurchaseOrdersPostOutputData

### ErrorResponseError

- `code` (string, required)
- `message` (string, required)
- `details` (map from string to any, optional)

### V1PurchaseOrdersPostInputPurchaseOrderItemsItems0

A purchase order item that is associated with a construction job

- `property_id` (string, required) — The Propexo unique identifier for the property
- `description` (string, required) — Description of the purchase order item
- `construction_job_id` (string, required) — The Propexo unique identifier for the construction job
- `stock_code` (string, required) — The stock code for the purchase order item. You'll have to request this data from your customer
- `quantity_ordered` (string, required) — The quantity ordered for the purchase order item
- `unit_price_in_cents` (integer, required) — The unit price, in cents, of the purchase order item
- `total_cost_in_cents` (integer, required) — The total cost, in cents, of the purchase order item
- `cost_code` (string, required) — The cost code of the purchase order item. You'll have to request this data from your customer
- `category_code` (string, required) — The category code for the purchase order item. You'll have to request this data from your customer
- `financial_account_id` (string, optional) — The Propexo unique identifier for the financial account

### V1PurchaseOrdersPostInputPurchaseOrderItemsItems1

A purchase order item that's not associated with a construction job

- `property_id` (string, required) — The Propexo unique identifier for the property
- `description` (string, required) — Description of the purchase order item
- `financial_account_id` (string, required) — The Propexo unique identifier for the financial account
- `stock_code` (string, required) — The stock code for the purchase order item. You'll have to request this data from your customer
- `quantity_ordered` (string, required) — The quantity ordered for the purchase order item
- `unit_price_in_cents` (integer, required) — The unit price, in cents, of the purchase order item
- `total_cost_in_cents` (integer, required) — The total cost, in cents, of the purchase order item

## Examples

**Request**

```json
{
  "integration_id": "string"
}
```

**Response**

```json
{
  "job_id": "string",
  "data": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.propexo.com/v1/purchase-orders/"

payload = { "integration_id": "string" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.propexo.com/v1/purchase-orders/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"integration_id":"string"}'
};

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

```go
package main

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

func main() {

	url := "https://api.propexo.com/v1/purchase-orders/"

	payload := strings.NewReader("{\n  \"integration_id\": \"string\"\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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
require 'uri'
require 'net/http'

url = URI("https://api.propexo.com/v1/purchase-orders/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"integration_id\": \"string\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.propexo.com/v1/purchase-orders/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"integration_id\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.propexo.com/v1/purchase-orders/', [
  'body' => '{
  "integration_id": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.propexo.com/v1/purchase-orders/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"integration_id\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["integration_id": "string"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.propexo.com/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()
```