Create a purchase order
Creates a new purchase order for products from a vendor.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (under Administrator) — Required to access Zenoti APIs.
Endpoint
POST /v1/purchase_orders
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| center_id | string (GUID) | Yes | Receiving center |
| vendor_id | string (GUID) | Yes | Vendor identifier |
| items | array | Yes | Array of { product_id, quantity, unit_cost } |
| notes | string | No | Order notes |
Response
Success (200 OK)
{
"id": "00000000-0000-0000-0000-edba065e4f6b",
"po_number": "PO-2026-00089",
"status": "Draft",
"total": 900.00,
"error": null
}
Response fields
| Field | Type | Description |
|---|---|---|
| id | string (GUID) | Purchase order identifier |
| po_number | string | Purchase order number |
| status | string | Draft, Submitted, Received, Cancelled |
| total | decimal | Total order amount |
Example
curl --request POST \
--url 'https://api.zenoti.com/v1/purchase_orders' \
--header 'Authorization: bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"center_id": "a3614939-16c0-4a7b-bc33-a69b106d855c",
"vendor_id": "00000000-0000-0000-0000-e2d16f7c4260",
"items": [{ "product_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "quantity": 50, "unit_cost": 18.00 }]
}'
const response = await fetch('https://api.zenoti.com/v1/purchase_orders', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
center_id: 'a3614939-16c0-4a7b-bc33-a69b106d855c',
vendor_id: '00000000-0000-0000-0000-e2d16f7c4260',
items: [
{ product_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', quantity: 50, unit_cost: 18 }
]
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/v1/purchase_orders',
headers={
'Authorization': 'bearer {{access_token}}',
},
json={'center_id': 'a3614939-16c0-4a7b-bc33-a69b106d855c', 'vendor_id': '00000000-0000-0000-0000-e2d16f7c4260', 'items': [{'product_id': 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'quantity': 50, 'unit_cost': 18}]}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
JsonSerializer.Serialize(new {
centerId = "a3614939-16c0-4a7b-bc33-a69b106d855c",
vendorId = "00000000-0000-0000-0000-e2d16f7c4260",
items = new[] {
new { productId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890", quantity = 50, unitCost = 18 }
}
}),
Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.zenoti.com/v1/purchase_orders", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/purchase_orders')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
request['Content-Type'] = 'application/json'
request.body = { center_id: 'a3614939-16c0-4a7b-bc33-a69b106d855c', vendor_id: '00000000-0000-0000-0000-e2d16f7c4260', items: [{ product_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', quantity: 50, unit_cost: 18 }] }.to_json
response = http.request(request)
data = JSON.parse(response.body)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.zenoti.com/v1/purchase_orders');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: bearer {{access_token}}',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['center_id' => 'a3614939-16c0-4a7b-bc33-a69b106d855c', 'vendor_id' => '00000000-0000-0000-0000-e2d16f7c4260', 'items' => [['product_id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'quantity' => 50, 'unit_cost' => 18]]]));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
Error codes
| Status | Description |
|---|---|
| 400 | Bad request — invalid or missing required fields |
| 401 | Unauthorized — invalid or expired access token |
| 429 | Too many requests — rate limit exceeded (60/min) |