PurchaseOrder header object plus the full PurchaseOrderItem array (the supplied items replace the existing ones); optionally include PurchaseOrderCustomField. The id comes from the path. The only hard-required fields are PurchaseOrder.supplier_id and, per line item, item, quantity and unit_price. The document type is set server-side.{ "result": "successful", "code": 200 }) is returned only when the send=direct query parameter is provided. Without it, a successful update responds with an HTTP 302 redirect to the v2 show page rather than a JSON body. Editing an order that has already been invoiced returns a 400 error.curl --location --globoff --request PUT 'https://.daftra.com/api2/purchase_orders/123.json?send=undefined' \
--header 'Accept: application/json' \
--header 'apikey: ' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"PurchaseOrder": {
"supplier_id": 3,
"is_offline":true,
"currency_code": "SAR",
"date": "30/06/2026"
},
"PurchaseOrderItem": [
{
"item": "Widget",
"quantity": 12,
"unit_price": 100,
"product_id": 12
}
]
}'{
"result": "successful",
"code": 200,
"message": "string"
}