Skip to main content
PUT
/
v1
/
purchase-orders
/
by-number
/
{poNumber}
Replace purchase order by PO number
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({})
};

fetch('https://api.dolfinai.co/v1/purchase-orders/by-number/{poNumber}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.dolfinai.co/v1/purchase-orders/by-number/{poNumber}"

payload = {}
headers = {"Content-Type": "application/json"}

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

print(response.text)
using RestSharp;


var options = new RestClientOptions("https://api.dolfinai.co/v1/purchase-orders/by-number/{poNumber}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{}", false);
var response = await client.PutAsync(request);

Console.WriteLine("{0}", response.Content);
curl --request PUT \
--url https://api.dolfinai.co/v1/purchase-orders/by-number/{poNumber} \
--header 'Content-Type: application/json' \
--data '{}'
{
  "poNumber": "<string>",
  "currency": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organisationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "supplierId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "externalRef": "<string>",
  "orderDate": "2023-11-07T05:31:56Z",
  "expectedDeliveryDate": "2023-11-07T05:31:56Z",
  "lines": [
    {
      "description": "<string>",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "sku": "<string>",
      "quantityOrdered": 123,
      "unit": "<string>",
      "unitPrice": 123,
      "taxRate": 123,
      "taxAmount": 123,
      "subTotal": 123,
      "sortOrder": 123,
      "matchedQuantity": 123,
      "fullyMatched": true
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}

Path Parameters

poNumber
string
required

Body

application/json

Full-representation update of a purchase order and its lines. Lines with a known id are updated in place, lines with no id are added, and omitted lines are removed. A line already matched to a bill cannot be removed or have its ordered quantity dropped below what is already matched.

supplierId
null | string<uuid>

Supplier the order is raised against. Optional.

externalRef
null | string

Caller's own reference for the order. Optional.

poNumber
null | string

Human purchase-order number printed on the order. Required.

currency
string

ISO 4217 currency code. Defaults to GBP.

orderDate
null | string<date-time>

Date the order was raised. Optional.

expectedDeliveryDate
null | string<date-time>

Expected delivery date. Optional.

lines
object[]

The full set of ordered lines after the edit.

Response

OK

A purchase order and its ordered lines.

poNumber
string
required

Human purchase-order number printed on the order. Required and unique within the organisation.

currency
string
required

ISO 4217 currency code of the order.

id
string<uuid>

Unique identifier of the purchase order.

organisationId
string<uuid>

The organisation that owns the purchase order.

supplierId
null | string<uuid>

The supplier the order is raised against, if assigned.

externalRef
null | string

Caller's own reference for the order (a reverse pointer to the platform's record), if any.

status
enum<string>

Lifecycle status: Draft, Open, PartiallyMatched, FullyMatched (all derived from matching), or the manual terminal states Closed / Cancelled.

Available options:
Draft,
Open,
PartiallyMatched,
FullyMatched,
Closed,
Cancelled
orderDate
null | string<date-time>

Date the order was raised, if recorded.

expectedDeliveryDate
null | string<date-time>

Expected delivery date, if recorded.

lines
object[]

The ordered lines, in display order.

createdAt
string<date-time>

When the purchase order was created.

updatedAt
string<date-time>

When the purchase order was last updated.