Purchase orders
Place orders with suppliers and read what is still to arrive.
On this page
List purchase orders
GET /erp/v1/purchase-orders
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
status | query | string | Nooptional | Only orders in this status. One of open, received |
supplierId | query | string (uuid) | Nooptional | Only the orders placed with this supplier. |
limit | query | integer | Nooptional | Records per page, from 1 to 500. Default 100 Range 1 – 500 |
cursor | query | string | Nooptional | The nextCursor of the previous page. |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | A page of purchase orders. | PurchaseOrderPage |
401 | The token is missing, has expired or is not ours. | Error |
403 | The token does not give access to this company or operation. | Error |
429 | There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. | Error |
503 | The service cannot answer now. | Error |
Request
curl
curl "$RDC_BASE_URL/erp/v1/purchase-orders?limit=20" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/purchase-orders?limit=20`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/erp/v1/purchase-orders?limit=20',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/purchase-orders?limit=20');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/erp/v1/purchase-orders?limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 200
{
"items": [
{
"id": "fa085fe6-560f-4b77-9ffe-df6f842189c9",
"number": "CA-0731",
"supplierId": "678cbd61-7ec7-49de-bff5-11581bfffffc",
"supplierName": "Ambalaje Carpatin SRL",
"date": "2026-11-18",
"status": "open",
"lines": [
{
"code": "AM-0518",
"name": "Paper bags, pack of 100",
"quantity": "200",
"unitPrice": "10.50",
"received": "0",
"open": "200"
}
],
"net": "2100.00",
"vat": "441.00",
"total": "2541.00",
"vatBreakdown": [
{
"rate": "21",
"base": "2100.00",
"vat": "441.00"
}
],
"currency": "RON",
"revision": 1
},
{
"id": "403660ee-f721-4e98-b224-59e59e245387",
"number": "CA-0729",
"supplierId": "e649fbee-e600-4db7-ab58-94e251d0fe9a",
"supplierName": "Brânzeturi Obcina SRL",
"date": "2026-11-10",
"status": "open",
"lines": [
{
"code": "LA-0307",
"name": "Cheese, 400 g",
"quantity": "96",
"unitPrice": "15.20",
"received": "90",
"open": "6"
}
],
"net": "1459.20",
"vat": "160.51",
"total": "1619.71",
"vatBreakdown": [
{
"rate": "11",
"base": "1459.20",
"vat": "160.51"
}
],
"currency": "RON",
"revision": 2
}
],
"nextCursor": null
} Create a purchase order
POST /erp/v1/purchase-orders
Places an order with a supplier. Only items that are bought can be ordered; a made item has a work order.
Request body
| Field | Type | Required | Meaning |
|---|---|---|---|
operationId | string (uuid) | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
supplierId | string (uuid) | Yesrequired | The supplier. It is the id of a partner. |
lines | PurchaseLineInput[] | Yesrequired | The lines: an item once each. |
lines[].code | string | Yesrequired | Code of the item. |
lines[].quantity | string | Yesrequired | Whole units, at least 1. |
lines[].unitPrice | string | Yesrequired | Net price of one unit, above zero. |
Responses
| Status | Meaning | Body |
|---|---|---|
202 | The change was accepted. The body is the operation result: aggregateId is the record that was created or changed. | OperationResult |
401 | The token is missing, has expired or is not ours. | Error |
403 | The token does not give access to this company or operation. | Error |
404 | partner_not_found: The customer or supplier does not exist, or is not one of the kind the request needs. item_not_found: The item does not exist. | Error |
409 | The operationId was used before with a different request. | Error |
422 | no_lines: The document has no line. duplicate_item: An item appears on more than one line. invalid_quantity: A quantity is not a whole number from 1 to 1000000. invalid_price: A price is not a positive amount. not_purchasable: The item is made in-house and cannot be put on a purchase order. | Error |
429 | There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. | Error |
503 | The service cannot answer now. | Error |
Request
curl
curl -X POST "$RDC_BASE_URL/erp/v1/purchase-orders" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "678d16d1-51ce-4f0f-838b-584b62e61789",
"supplierId": "14b3279c-01f1-464f-bad7-ff50dadac05f",
"lines": [
{
"code": "FA-0010",
"quantity": "4",
"unitPrice": "32.50"
}
]
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/purchase-orders`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "678d16d1-51ce-4f0f-838b-584b62e61789",
"supplierId": "14b3279c-01f1-464f-bad7-ff50dadac05f",
"lines": [
{
"code": "FA-0010",
"quantity": "4",
"unitPrice": "32.50"
}
]
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/erp/v1/purchase-orders',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '678d16d1-51ce-4f0f-838b-584b62e61789',
'supplierId': '14b3279c-01f1-464f-bad7-ff50dadac05f',
'lines': [
{
'code': 'FA-0010',
'quantity': '4',
'unitPrice': '32.50',
},
],
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "678d16d1-51ce-4f0f-838b-584b62e61789",
"supplierId": "14b3279c-01f1-464f-bad7-ff50dadac05f",
"lines": [
{
"code": "FA-0010",
"quantity": "4",
"unitPrice": "32.50"
}
]
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/purchase-orders');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/erp/v1/purchase-orders");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "678d16d1-51ce-4f0f-838b-584b62e61789",
"supplierId": "14b3279c-01f1-464f-bad7-ff50dadac05f",
"lines": [
{
"code": "FA-0010",
"quantity": "4",
"unitPrice": "32.50"
}
]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 202
{
"operationId": "678d16d1-51ce-4f0f-838b-584b62e61789",
"status": "accepted",
"aggregateId": "fb086179-5513-43e2-a802-1a277c3b0d01",
"aggregateRevision": 1
} Get a purchase order
GET /erp/v1/purchase-orders/{purchaseOrderId}
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
purchaseOrderId | path | string (uuid) | Yesrequired | The purchase order. |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | The order with what was received and what is still open on each line. | PurchaseOrder |
401 | The token is missing, has expired or is not ours. | Error |
403 | The token does not give access to this company or operation. | Error |
404 | The purchase order does not exist. | Error |
429 | There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. | Error |
503 | The service cannot answer now. | Error |
Request
curl
curl "$RDC_BASE_URL/erp/v1/purchase-orders/403660ee-f721-4e98-b224-59e59e245387" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/purchase-orders/403660ee-f721-4e98-b224-59e59e245387`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/erp/v1/purchase-orders/403660ee-f721-4e98-b224-59e59e245387',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/purchase-orders/403660ee-f721-4e98-b224-59e59e245387');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/erp/v1/purchase-orders/403660ee-f721-4e98-b224-59e59e245387");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 200
{
"id": "403660ee-f721-4e98-b224-59e59e245387",
"number": "CA-0729",
"supplierId": "e649fbee-e600-4db7-ab58-94e251d0fe9a",
"supplierName": "Brânzeturi Obcina SRL",
"date": "2026-11-10",
"status": "open",
"lines": [
{
"code": "LA-0307",
"name": "Cheese, 400 g",
"quantity": "96",
"unitPrice": "15.20",
"received": "90",
"open": "6"
}
],
"net": "1459.20",
"vat": "160.51",
"total": "1619.71",
"vatBreakdown": [
{
"rate": "11",
"base": "1459.20",
"vat": "160.51"
}
],
"currency": "RON",
"revision": 2
}