Skip to main content
POST
/
purchase-orders
/
{id}
/
close
Close purchase order
const options = {method: 'POST'};

fetch('https://api.dolfinai.co/purchase-orders/{id}/close', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "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"
}

Path Parameters

id
string<uuid>
required

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.